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

 ##########
 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:
   This looks odd.
   Can you clarify why is this replacement needed?

----------------------------------------------------------------
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