You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@calcite.apache.org by GitBox <gi...@apache.org> on 2020/02/12 07:35:49 UTC

[GitHub] [calcite] vlsi commented on a change in pull request #1790: [CALCITE-3769] Deprecate TableScanRule

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:
users@infra.apache.org


With regards,
Apache Git Services