You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hudi.apache.org by "1032851561 (via GitHub)" <gi...@apache.org> on 2023/03/07 07:30:04 UTC

[GitHub] [hudi] 1032851561 commented on a diff in pull request #8098: [SUPPORT] select error if table schema includes computed column

1032851561 commented on code in PR #8098:
URL: https://github.com/apache/hudi/pull/8098#discussion_r1127458447


##########
hudi-flink-datasource/hudi-flink/src/main/java/org/apache/hudi/table/HoodieTableFactory.java:
##########
@@ -75,7 +76,7 @@ public DynamicTableSource createDynamicTableSource(Context context) {
     Path path = new Path(conf.getOptional(FlinkOptions.PATH).orElseThrow(() ->
         new ValidationException("Option [path] should not be empty.")));
     setupTableOptions(conf.getString(FlinkOptions.PATH), conf);
-    ResolvedSchema schema = context.getCatalogTable().getResolvedSchema();
+    ResolvedSchema schema = ResolvedSchema.of(context.getCatalogTable().getResolvedSchema().getColumns().stream().filter(c-> !(c instanceof Column.ComputedColumn)).collect(Collectors.toList()));
     setupConfOptions(conf, context.getObjectIdentifier(), context.getCatalogTable(), schema);

Review Comment:
   org.apache.hudi.table.format.cow.ParquetSplitReaderUtil#genPartColumnarRowReader
   ```
       List<String> selNonPartNames = Arrays.stream(selectedFields)
           .mapToObj(i -> fullFieldNames[i])
           .filter(n -> !partitionSpec.containsKey(n))
           .collect(Collectors.toList());
   ```
   selectFields=[0,1,2,3],fullFieldNames=[id,name,create_date],fullFieldNames is from  commited metadata.



-- 
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: commits-unsubscribe@hudi.apache.org

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