vlsi commented on a change in pull request #1790: [CALCITE-3769] Deprecate 
TableScanRule
URL: https://github.com/apache/calcite/pull/1790#discussion_r378197263
 
 

 ##########
 File path: core/src/main/java/org/apache/calcite/tools/RelRunners.java
 ##########
 @@ -29,6 +35,19 @@ private RelRunners() {}
 
   /** Runs a relational expression by creating a JDBC connection. */
   public static PreparedStatement run(RelNode rel) {
+    final RelShuttle shuttle = new RelHomogeneousShuttle() {
+      @Override public RelNode visit(TableScan scan) {
+        final RelOptTable table = scan.getTable();
+        if (scan instanceof LogicalTableScan
+            && Bindables.BindableTableScan.canHandle(table)) {
+          // Always replace the LogicalTableScan with BindableTableScan
+          // because it's implementation does not require a "schema" as 
context.
+          return Bindables.BindableTableScan.create(scan.getCluster(), table);
 
 Review comment:
   Can the clients of Relrunners do the appropriate conversion instead?
   
   org.apache.calcite.tools.RelRunners#run API says nothing on what changes 
would it make to the input rel node.
   It might be very unexpected for those who see just the call to 
`RelRunners.run(root))`.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to