You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@paimon.apache.org by "JingsongLi (via GitHub)" <gi...@apache.org> on 2024/03/18 10:08:01 UTC

Re: [PR] Support deletion file for primary key table. [incubator-paimon-trino]

JingsongLi commented on code in PR #59:
URL: https://github.com/apache/incubator-paimon-trino/pull/59#discussion_r1528248647


##########
paimon-trino-common/src/main/java/org/apache/paimon/trino/TrinoPageSourceProvider.java:
##########
@@ -126,60 +128,82 @@ private ConnectorPageSource createPageSource(
                         .map(TrinoColumnHandle.class::cast)
                         .map(TrinoColumnHandle::getColumnName)
                         .toList();
-        int[] columnIndex =
-                // the column index, very important
-                projectedFields.stream().mapToInt(fieldNames::indexOf).toArray();
-
         TrinoFileSystem fileSystem = fileSystemFactory.create(session);
 
         try {
             Split paimonSplit = split.decodeSplit();
             Optional<List<RawFile>> optionalRawFiles = paimonSplit.convertToRawFiles();
             if (checkRawFile(optionalRawFiles)) {
+                Optional<List<DeletionFile>> deletionFiles = paimonSplit.deletionFiles();
+
                 FileStoreTable fileStoreTable = (FileStoreTable) table;
                 SchemaManager schemaManager =
                         new SchemaManager(fileStoreTable.fileIO(), fileStoreTable.location());
+
+                int offset = table.primaryKeys().isEmpty() ? 0 : table.primaryKeys().size() + 2;

Review Comment:
   It is better to use names instead of offsets to read orc.



-- 
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: issues-unsubscribe@paimon.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org