AMashenkov commented on code in PR #6599:
URL: https://github.com/apache/ignite-3/pull/6599#discussion_r2354826867


##########
modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/prepare/ddl/DdlSqlToCommandConverter.java:
##########
@@ -365,6 +365,11 @@ private CompletableFuture<CatalogCommand> 
convertCreateTable(IgniteSqlCreateTabl
         }
 
         IgniteSqlPrimaryKeyConstraint pkConstraint = pkConstraints.get(0);
+        String pkName = null;
+        SqlIdentifier pkIdentifier = pkConstraint.getName();
+        if (pkIdentifier != null) {
+            pkName = deriveObjectName(pkIdentifier, ctx, "name of pk 
constraint");
+        }

Review Comment:
   Why can't we do like this to avoid @Nullable arguments\fields in 
TablePrimaryKey classes? 
   ```suggestion
           SqlIdentifier pkIdentifier = pkConstraint.getName();
           String tableName = deriveObjectName(createTblNode.name(), ctx, 
"tableName")
           String pkName = pkIdentifier != null 
                    ? deriveObjectName(pkIdentifier, ctx, "name of pk 
constraint")
                    : pkIndexName(tableName);
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to