pvillard31 commented on code in PR #10269:
URL: https://github.com/apache/nifi/pull/10269#discussion_r2322510633
##########
nifi-commons/nifi-calcite-utils/src/main/java/org/apache/nifi/sql/internal/NiFiTableScan.java:
##########
@@ -51,6 +51,15 @@ protected NiFiTableScan(final RelOptCluster cluster, final
RelOptTable table, fi
super(cluster, cluster.traitSetOf(EnumerableConvention.INSTANCE),
Collections.emptyList(), table);
this.fields = fields;
fieldExpression = Expressions.constant(fields);
+ // Ensure projection pushdown rule is registered with the planner, as
some Calcite versions
+ // may not invoke the RelNode#register() method.
+ try {
+ cluster.getPlanner().addRule(new
NiFiProjectTableScanRule(NiFiProjectTableScanRule.Config.DEFAULT));
+ } catch (Exception e) {
+ // Rule may already be registered; intentionally ignored to avoid
duplicate registration errors.
+ // Touch the exception to avoid PMD EmptyCatchBlock warnings
+ e.getClass();
+ }
Review Comment:
oh nice, thanks, I didn't know that!
--
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]