diff options
Diffstat (limited to 'exec/java-exec/src/main/java/org/apache/drill/exec/planner/sql/SqlConverter.java')
-rw-r--r-- | exec/java-exec/src/main/java/org/apache/drill/exec/planner/sql/SqlConverter.java | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/planner/sql/SqlConverter.java b/exec/java-exec/src/main/java/org/apache/drill/exec/planner/sql/SqlConverter.java index 154bf8cbb..62d6f325d 100644 --- a/exec/java-exec/src/main/java/org/apache/drill/exec/planner/sql/SqlConverter.java +++ b/exec/java-exec/src/main/java/org/apache/drill/exec/planner/sql/SqlConverter.java @@ -119,6 +119,14 @@ public class SqlConverter { private VolcanoPlanner planner; private boolean useRootSchema = false; + static { + /* + * Sets value to false to avoid simplifying project expressions + * during creating new projects since it may cause changing data mode + * which causes to assertion errors during type validation + */ + Hook.REL_BUILDER_SIMPLIFY.add(Hook.propertyJ(false)); + } public SqlConverter(QueryContext context) { this.settings = context.getPlannerSettings(); @@ -373,13 +381,6 @@ public class SqlConverter { new SqlToRelConverter(new Expander(), validator, catalog, cluster, DrillConvertletTable.INSTANCE, sqlToRelConverterConfig); - /* - * Sets value to false to avoid simplifying project expressions - * during creating new projects since it may cause changing data mode - * which causes to assertion errors during type validation - */ - Hook.REL_BUILDER_SIMPLIFY.add(Hook.propertyJ(false)); - //To avoid unexpected column errors set a value of top to false final RelRoot rel = sqlToRelConverter.convertQuery(validatedNode, false, false); return rel.withRel(sqlToRelConverter.flattenTypes(rel.rel, true)); |