lowka commented on code in PR #3214:
URL: https://github.com/apache/ignite-3/pull/3214#discussion_r1491147459


##########
modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/schema/IgniteTableImpl.java:
##########
@@ -43,16 +51,62 @@ public class IgniteTableImpl extends 
AbstractIgniteDataSource implements IgniteT
     private final Lazy<NativeType[]> colocationColumnTypes;
 
     /** Constructor. */
-    public IgniteTableImpl(String name, int id, int version, TableDescriptor 
desc,
-            Statistic statistic, Map<String, IgniteIndex> indexMap, int 
partitions) {
-
+    public IgniteTableImpl(
+            String name,
+            int id,
+            int version,
+            TableDescriptor desc,
+            ImmutableIntList keyColumns,
+            Statistic statistic,
+            Map<String, IgniteIndex> indexMap,
+            int partitions
+    ) {
         super(name, id, version, desc, statistic);
+
+        this.keyColumns = keyColumns;
         this.indexMap = indexMap;
         this.partitions = partitions;
+        this.columnsToInsert = deriveColumnsToInsert(desc);
 
         colocationColumnTypes = new Lazy<>(this::evaluateTypes);
     }
 
+    private static RelDataType deriveDeleteRowType(
+            IgniteTypeFactory typeFactory,
+            TableDescriptor desc,
+            ImmutableIntList keyColumns
+    ) {
+        var builder = new RelDataTypeFactory.Builder(typeFactory);
+
+        RelDataType fullRow = desc.rowType(typeFactory, null);
+        for (int i : keyColumns) {
+            builder.add(fullRow.getFieldList().get(i));
+        }
+
+        return builder.build();
+    }
+
+    private static @Nullable ImmutableBitSet 
deriveColumnsToInsert(TableDescriptor desc) {
+        ImmutableBitSet.Builder builder = ImmutableBitSet.builder();
+
+        boolean hiddenColumnFound = false;
+        for (ColumnDescriptor columnDescriptor : desc) {
+            if (columnDescriptor.hidden()) {

Review Comment:
   Maybe It would be better to leave a comment explaining why this is needed?



-- 
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