ibzib commented on a change in pull request #15216:
URL: https://github.com/apache/beam/pull/15216#discussion_r677012282
##########
File path:
sdks/java/extensions/sql/src/main/java/org/apache/beam/sdk/extensions/sql/meta/provider/SchemaIOTableProviderWrapper.java
##########
@@ -118,6 +123,34 @@ public Schema getSchema() {
return begin.apply(readerTransform);
}
+ @Override
+ public PCollection<Row> buildIOReader(
+ PBegin begin, BeamSqlTableFilter filters, List<String> fieldNames) {
+ PTransform<PBegin, PCollection<Row>> readerTransform =
schemaIO.buildReader();
+ if (readerTransform instanceof PushdownProjector) {
+ PushdownProjector pushdownProjector = (PushdownProjector)
readerTransform;
+ FieldAccessDescriptor fieldAccessDescriptor =
+ FieldAccessDescriptor.withFieldNames(fieldNames);
+ // The pushdown must return a PTransform that can be applied to a
PBegin, or this cast will
+ // fail.
+ readerTransform =
+ (PTransform<PBegin, PCollection<Row>>)
+
pushdownProjector.withProjectionPushdown(fieldAccessDescriptor);
+ }
Review comment:
Done.
--
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]