aboutsummaryrefslogtreecommitdiff
path: root/exec/java-exec/src/main/java/org/apache/drill/exec/planner/logical/DrillScanRel.java
diff options
context:
space:
mode:
authorHanifi Gunes <hgunes@maprtech.com>2015-03-05 13:35:48 -0800
committerHanifi Gunes <hgunes@maprtech.com>2015-03-18 14:21:23 -0700
commit54df129cab544c3df8e75a7dae3f85a91a9ded5a (patch)
tree04636ff28b3376bd617893aacbde69d19b0fbdea /exec/java-exec/src/main/java/org/apache/drill/exec/planner/logical/DrillScanRel.java
parent12a7d01791bb9ad0126f2dccf2100f09668861d1 (diff)
DRILL-2358: Ensure DrillScanRel differentiates skip-all, scan-all & scan-some in a backward compatible fashion
Diffstat (limited to 'exec/java-exec/src/main/java/org/apache/drill/exec/planner/logical/DrillScanRel.java')
-rw-r--r--exec/java-exec/src/main/java/org/apache/drill/exec/planner/logical/DrillScanRel.java11
1 files changed, 8 insertions, 3 deletions
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/planner/logical/DrillScanRel.java b/exec/java-exec/src/main/java/org/apache/drill/exec/planner/logical/DrillScanRel.java
index 45e10585f..ab3d61b50 100644
--- a/exec/java-exec/src/main/java/org/apache/drill/exec/planner/logical/DrillScanRel.java
+++ b/exec/java-exec/src/main/java/org/apache/drill/exec/planner/logical/DrillScanRel.java
@@ -25,7 +25,6 @@ import org.apache.drill.common.exceptions.DrillRuntimeException;
import org.apache.drill.common.expression.SchemaPath;
import org.apache.drill.common.logical.data.LogicalOperator;
import org.apache.drill.common.logical.data.Scan;
-import org.apache.drill.exec.physical.base.AbstractGroupScan;
import org.apache.drill.exec.physical.base.GroupScan;
import org.apache.drill.exec.physical.base.ScanStats;
import org.apache.drill.exec.planner.common.DrillScanRelBase;
@@ -59,7 +58,7 @@ public class DrillScanRel extends DrillScanRelBase implements DrillRel {
RelOptTable table) {
// By default, scan does not support project pushdown.
// Decision whether push projects into scan will be made solely in DrillPushProjIntoScanRule.
- this(cluster, traits, table, table.getRowType(), AbstractGroupScan.ALL_COLUMNS);
+ this(cluster, traits, table, table.getRowType(), GroupScan.ALL_COLUMNS);
}
/** Creates a DrillScan. */
@@ -67,7 +66,13 @@ public class DrillScanRel extends DrillScanRelBase implements DrillRel {
RelOptTable table, RelDataType rowType, List<SchemaPath> columns) {
super(DRILL_LOGICAL, cluster, traits, table);
this.rowType = rowType;
- this.columns = columns == null || columns.size() == 0 ? GroupScan.ALL_COLUMNS : columns;
+ if (columns == null) { // planner asks to scan all of the columns
+ this.columns = ColumnList.all();
+ } else if (columns.size() == 0) { // planner asks to skip all of the columns
+ this.columns = ColumnList.none();
+ } else { // planner asks to scan some columns
+ this.columns = ColumnList.some(columns);
+ }
try {
this.groupScan = drillTable.getGroupScan().clone(this.columns);
} catch (IOException e) {