drill-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j..@apache.org
Subject drill git commit: DRILL-1921: Disable union, intersect, except, natural join, cross join; Disable 'cardinality' ; Disable types tinyint, smallint, real, multiset
Date Sun, 08 Feb 2015 03:17:19 GMT
Repository: drill
Updated Branches:
  refs/heads/master c54bd6acb -> 0d867b0da


DRILL-1921: Disable union, intersect, except, natural join, cross join; Disable 'cardinality'
;  Disable types tinyint, smallint, real, multiset


Project: http://git-wip-us.apache.org/repos/asf/drill/repo
Commit: http://git-wip-us.apache.org/repos/asf/drill/commit/0d867b0d
Tree: http://git-wip-us.apache.org/repos/asf/drill/tree/0d867b0d
Diff: http://git-wip-us.apache.org/repos/asf/drill/diff/0d867b0d

Branch: refs/heads/master
Commit: 0d867b0da5272028b6bcacea0ed280930e6b113f
Parents: c54bd6a
Author: Hsuan-Yi Chu <hsuanyi@usc.edu>
Authored: Sun Feb 1 09:00:12 2015 -0800
Committer: Hsuan-Yi Chu <hsuanyi@usc.edu>
Committed: Fri Feb 6 17:29:37 2015 -0800

----------------------------------------------------------------------
 .../exception/UnsupportedOperatorCollector.java |  62 ++++++++++
 .../planner/sql/handlers/DefaultSqlHandler.java |  18 ++-
 .../sql/parser/UnsupportedOperatorsVisitor.java | 123 +++++++++++++++++++
 .../work/foreman/SqlUnsupportedException.java   |  32 +++++
 .../foreman/UnsupportedDataTypeException.java   |  26 ++++
 .../foreman/UnsupportedFunctionException.java   |  26 ++++
 .../UnsupportedRelOperatorException.java        |  24 ++++
 .../apache/drill/TestDisabledFunctionality.java |  84 +++++++++++++
 8 files changed, 393 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/drill/blob/0d867b0d/exec/java-exec/src/main/java/org/apache/drill/exec/exception/UnsupportedOperatorCollector.java
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/exception/UnsupportedOperatorCollector.java
b/exec/java-exec/src/main/java/org/apache/drill/exec/exception/UnsupportedOperatorCollector.java
new file mode 100644
index 0000000..aec792b
--- /dev/null
+++ b/exec/java-exec/src/main/java/org/apache/drill/exec/exception/UnsupportedOperatorCollector.java
@@ -0,0 +1,62 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.drill.exec.exception;
+
+import org.apache.drill.exec.work.foreman.SqlUnsupportedException;
+import org.apache.drill.exec.work.foreman.UnsupportedDataTypeException;
+import org.apache.drill.exec.work.foreman.UnsupportedFunctionException;
+import org.apache.drill.exec.work.foreman.UnsupportedRelOperatorException;
+
+public class UnsupportedOperatorCollector {
+    private SqlUnsupportedException.ExceptionType exceptionType;
+    private String jiraNumber;
+    private String message;
+
+    public UnsupportedOperatorCollector() {
+        exceptionType = SqlUnsupportedException.ExceptionType.NONE;
+    }
+
+    public boolean convertException() throws SqlUnsupportedException {
+      switch (exceptionType) {
+        case RELATIONAL:
+          throw new UnsupportedRelOperatorException(jiraNumber, message);
+        case DATA_TYPE:
+          throw new UnsupportedDataTypeException(jiraNumber, message);
+        case FUNCTION:
+          throw new UnsupportedFunctionException(jiraNumber, message);
+        default:
+          break;
+      }
+
+      return false;
+    }
+
+    public void setException(SqlUnsupportedException.ExceptionType exceptionType, String
jiraNumber, String message) {
+      if(this.exceptionType != SqlUnsupportedException.ExceptionType.NONE) {
+        throw new IllegalStateException("Exception was set already");
+      }
+
+      this.exceptionType = exceptionType;
+      this.jiraNumber = jiraNumber;
+      this.message = message;
+    }
+
+    public void clean() {
+      exceptionType = SqlUnsupportedException.ExceptionType.NONE;
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/drill/blob/0d867b0d/exec/java-exec/src/main/java/org/apache/drill/exec/planner/sql/handlers/DefaultSqlHandler.java
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/planner/sql/handlers/DefaultSqlHandler.java
b/exec/java-exec/src/main/java/org/apache/drill/exec/planner/sql/handlers/DefaultSqlHandler.java
index 79603eb..6b3d301 100644
--- a/exec/java-exec/src/main/java/org/apache/drill/exec/planner/sql/handlers/DefaultSqlHandler.java
+++ b/exec/java-exec/src/main/java/org/apache/drill/exec/planner/sql/handlers/DefaultSqlHandler.java
@@ -55,6 +55,7 @@ import org.apache.drill.exec.planner.physical.visitor.SelectionVectorPrelVisitor
 import org.apache.drill.exec.planner.physical.visitor.SplitUpComplexExpressions;
 import org.apache.drill.exec.planner.physical.visitor.StarColumnConverter;
 import org.apache.drill.exec.planner.sql.DrillSqlWorker;
+import org.apache.drill.exec.planner.sql.parser.UnsupportedOperatorsVisitor;
 import org.apache.drill.exec.server.options.OptionManager;
 import org.apache.drill.exec.server.options.OptionValue;
 import org.apache.drill.exec.util.Pointer;
@@ -120,7 +121,6 @@ public class DefaultSqlHandler extends AbstractSqlHandler {
 
   @Override
   public PhysicalPlan getPlan(SqlNode sqlNode) throws ValidationException, RelConversionException,
IOException, ForemanSetupException {
-
     SqlNode rewrittenSqlNode = rewrite(sqlNode);
     SqlNode validated = validateNode(rewrittenSqlNode);
     RelNode rel = convertToRel(validated);
@@ -142,7 +142,21 @@ public class DefaultSqlHandler extends AbstractSqlHandler {
   }
 
   protected SqlNode validateNode(SqlNode sqlNode) throws ValidationException, RelConversionException,
ForemanSetupException {
-    return planner.validate(sqlNode);
+    SqlNode sqlNodeValidated = planner.validate(sqlNode);
+
+    // Check if the unsupported functionality is used
+    UnsupportedOperatorsVisitor visitor = UnsupportedOperatorsVisitor.getVisitor();
+    try {
+      sqlNodeValidated.accept(visitor);
+    } catch (UnsupportedOperationException ex) {
+      // If the exception due to the unsupported functionalities
+      visitor.convertException();
+
+      // If it is not, let this exception move forward to higher logic
+      throw ex;
+    }
+
+    return sqlNodeValidated;
   }
 
   protected RelNode convertToRel(SqlNode node) throws RelConversionException {

http://git-wip-us.apache.org/repos/asf/drill/blob/0d867b0d/exec/java-exec/src/main/java/org/apache/drill/exec/planner/sql/parser/UnsupportedOperatorsVisitor.java
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/planner/sql/parser/UnsupportedOperatorsVisitor.java
b/exec/java-exec/src/main/java/org/apache/drill/exec/planner/sql/parser/UnsupportedOperatorsVisitor.java
new file mode 100644
index 0000000..8fedcce
--- /dev/null
+++ b/exec/java-exec/src/main/java/org/apache/drill/exec/planner/sql/parser/UnsupportedOperatorsVisitor.java
@@ -0,0 +1,123 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.drill.exec.planner.sql.parser;
+
+import org.apache.drill.exec.exception.UnsupportedOperatorCollector;
+import org.apache.drill.exec.work.foreman.SqlUnsupportedException;
+import org.eigenbase.sql.SqlKind;
+import org.eigenbase.sql.SqlJoin;
+import org.eigenbase.sql.JoinType;
+import org.eigenbase.sql.SqlNode;
+import org.eigenbase.sql.type.SqlTypeName;
+import org.eigenbase.sql.util.SqlShuttle;
+import org.eigenbase.sql.SqlDataTypeSpec;
+import org.eigenbase.sql.SqlSetOperator;
+import java.util.List;
+import com.google.common.collect.Lists;
+
+public class UnsupportedOperatorsVisitor extends SqlShuttle {
+  private static List<String> disabledType = Lists.newArrayList();
+  private static List<String> disabledOperators = Lists.newArrayList();
+
+  static {
+    disabledType.add(SqlTypeName.TINYINT.name());
+    disabledType.add(SqlTypeName.SMALLINT.name());
+    disabledType.add(SqlTypeName.REAL.name());
+    disabledOperators.add("CARDINALITY");
+  }
+
+  private static UnsupportedOperatorsVisitor visitor = new UnsupportedOperatorsVisitor();
+
+  private UnsupportedOperatorCollector unsupportedOperatorCollector;
+
+  private UnsupportedOperatorsVisitor() {
+    unsupportedOperatorCollector = new UnsupportedOperatorCollector();
+  }
+
+  public static UnsupportedOperatorsVisitor getVisitor() {
+    visitor.unsupportedOperatorCollector.clean();
+    return visitor;
+  }
+
+  public void convertException() throws SqlUnsupportedException {
+    unsupportedOperatorCollector.convertException();
+  }
+
+  @Override
+  public SqlNode visit(SqlDataTypeSpec type) {
+    for(String strType : disabledType) {
+      if(type.getTypeName().getSimple().equalsIgnoreCase(strType)) {
+        unsupportedOperatorCollector.setException(SqlUnsupportedException.ExceptionType.DATA_TYPE,
+            "1959", type.getTypeName().getSimple());
+        throw new UnsupportedOperationException();
+      }
+    }
+
+    return type;
+  }
+
+  @Override
+  public SqlNode visit(org.eigenbase.sql.SqlCall sqlCall) {
+    // Disable unsupported Intersect, Except
+    if(sqlCall.getKind() == SqlKind.INTERSECT || sqlCall.getKind() == SqlKind.EXCEPT) {
+      unsupportedOperatorCollector.setException(SqlUnsupportedException.ExceptionType.RELATIONAL,
+          "1921", sqlCall.getOperator().getName());
+      throw new UnsupportedOperationException();
+    }
+
+    // Disable unsupported Union
+    if(sqlCall.getKind() == SqlKind.UNION) {
+      SqlSetOperator op = (SqlSetOperator) sqlCall.getOperator();
+      if (!op.isAll()) {
+        unsupportedOperatorCollector.setException(SqlUnsupportedException.ExceptionType.RELATIONAL,
+            "1921", sqlCall.getOperator().getName());
+        throw new UnsupportedOperationException();
+      }
+    }
+
+    // Disable unsupported JOINs
+    if(sqlCall.getKind() == SqlKind.JOIN) {
+      SqlJoin join = (SqlJoin) sqlCall;
+
+      // Block Natural Join
+      if(join.isNatural()) {
+        unsupportedOperatorCollector.setException(SqlUnsupportedException.ExceptionType.RELATIONAL,
+            "1986", "NATURAL " + sqlCall.getOperator().getName());
+        throw new UnsupportedOperationException();
+      }
+
+      // Block Cross Join
+      if(join.getJoinType() == JoinType.CROSS) {
+        unsupportedOperatorCollector.setException(SqlUnsupportedException.ExceptionType.RELATIONAL,
+            "1921", "CROSS " + sqlCall.getOperator().getName());
+        throw new UnsupportedOperationException();
+      }
+    }
+
+    // Disable Function
+    for(String strOperator : disabledOperators) {
+      if(sqlCall.getOperator().isName(strOperator)) {
+        unsupportedOperatorCollector.setException(SqlUnsupportedException.ExceptionType.FUNCTION,
+            "2115", sqlCall.getOperator().getName());
+        throw new UnsupportedOperationException();
+      }
+    }
+
+    return sqlCall.getOperator().acceptCall(this, sqlCall);
+  }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/drill/blob/0d867b0d/exec/java-exec/src/main/java/org/apache/drill/exec/work/foreman/SqlUnsupportedException.java
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/work/foreman/SqlUnsupportedException.java
b/exec/java-exec/src/main/java/org/apache/drill/exec/work/foreman/SqlUnsupportedException.java
new file mode 100644
index 0000000..c5ba683
--- /dev/null
+++ b/exec/java-exec/src/main/java/org/apache/drill/exec/work/foreman/SqlUnsupportedException.java
@@ -0,0 +1,32 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.drill.exec.work.foreman;
+
+public abstract class SqlUnsupportedException extends ForemanSetupException {
+  public enum ExceptionType {
+    NONE, RELATIONAL, DATA_TYPE, FUNCTION
+  }
+
+  public SqlUnsupportedException(String jiraNumber, String disabledFunctionality) {
+    super(disabledFunctionality + " is not supported\n" +
+        "See Apache Drill JIRA: DRILL-" + jiraNumber);
+  }
+}
+
+

http://git-wip-us.apache.org/repos/asf/drill/blob/0d867b0d/exec/java-exec/src/main/java/org/apache/drill/exec/work/foreman/UnsupportedDataTypeException.java
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/work/foreman/UnsupportedDataTypeException.java
b/exec/java-exec/src/main/java/org/apache/drill/exec/work/foreman/UnsupportedDataTypeException.java
new file mode 100644
index 0000000..cac753b
--- /dev/null
+++ b/exec/java-exec/src/main/java/org/apache/drill/exec/work/foreman/UnsupportedDataTypeException.java
@@ -0,0 +1,26 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.drill.exec.work.foreman;
+
+import org.eigenbase.sql.SqlDataTypeSpec;
+
+public class UnsupportedDataTypeException extends SqlUnsupportedException {
+  public UnsupportedDataTypeException(String drillJiraNumber, String message) {
+    super(drillJiraNumber, message);
+  }
+}

http://git-wip-us.apache.org/repos/asf/drill/blob/0d867b0d/exec/java-exec/src/main/java/org/apache/drill/exec/work/foreman/UnsupportedFunctionException.java
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/work/foreman/UnsupportedFunctionException.java
b/exec/java-exec/src/main/java/org/apache/drill/exec/work/foreman/UnsupportedFunctionException.java
new file mode 100644
index 0000000..216a75a
--- /dev/null
+++ b/exec/java-exec/src/main/java/org/apache/drill/exec/work/foreman/UnsupportedFunctionException.java
@@ -0,0 +1,26 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.drill.exec.work.foreman;
+
+import org.eigenbase.sql.SqlOperator;
+
+public class UnsupportedFunctionException extends SqlUnsupportedException {
+  public UnsupportedFunctionException(String drillJiraNumber, String message) {
+    super(drillJiraNumber, message);
+  }
+}

http://git-wip-us.apache.org/repos/asf/drill/blob/0d867b0d/exec/java-exec/src/main/java/org/apache/drill/exec/work/foreman/UnsupportedRelOperatorException.java
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/work/foreman/UnsupportedRelOperatorException.java
b/exec/java-exec/src/main/java/org/apache/drill/exec/work/foreman/UnsupportedRelOperatorException.java
new file mode 100644
index 0000000..2dbae4c
--- /dev/null
+++ b/exec/java-exec/src/main/java/org/apache/drill/exec/work/foreman/UnsupportedRelOperatorException.java
@@ -0,0 +1,24 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.drill.exec.work.foreman;
+
+public class UnsupportedRelOperatorException extends SqlUnsupportedException {
+  public UnsupportedRelOperatorException(String drillJiraNumber, String message) {
+    super(drillJiraNumber, message);
+  }
+}

http://git-wip-us.apache.org/repos/asf/drill/blob/0d867b0d/exec/java-exec/src/test/java/org/apache/drill/TestDisabledFunctionality.java
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/test/java/org/apache/drill/TestDisabledFunctionality.java
b/exec/java-exec/src/test/java/org/apache/drill/TestDisabledFunctionality.java
new file mode 100644
index 0000000..241ee15
--- /dev/null
+++ b/exec/java-exec/src/test/java/org/apache/drill/TestDisabledFunctionality.java
@@ -0,0 +1,84 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.drill;
+import org.apache.drill.exec.rpc.RpcException;
+import org.junit.Test;
+
+public class TestDisabledFunctionality extends BaseTestQuery{
+  static final org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(TestExampleQueries.class);
+
+  @Test(expected = RpcException.class) // see DRILL-1921
+  public void testDisabledUnion() throws Exception {
+    test("(select n_name as name from cp.`tpch/nation.parquet`) UNION (select r_name as name
from cp.`tpch/region.parquet`)");
+  }
+
+  @Test(expected = RpcException.class) // see DRILL-1921
+  public void testDisabledUnionDistinct() throws Exception {
+    test("(select n_name as name from cp.`tpch/nation.parquet`) UNION DISTINCT (select r_name
as name from cp.`tpch/region.parquet`)");
+  }
+
+  @Test(expected = RpcException.class) // see DRILL-1921
+  public void testDisabledIntersect() throws Exception {
+    test("(select n_name as name from cp.`tpch/nation.parquet`) INTERSECT (select r_name
as name from cp.`tpch/region.parquet`)");
+  }
+
+  @Test(expected = RpcException.class) // see DRILL-1921
+  public void testDisabledIntersectALL() throws Exception {
+    test("(select n_name as name from cp.`tpch/nation.parquet`) INTERSECT ALL (select r_name
as name from cp.`tpch/region.parquet`)");
+  }
+
+  @Test(expected = RpcException.class) // see DRILL-1921
+  public void testDisabledExceptALL() throws Exception {
+    test("(select n_name as name from cp.`tpch/nation.parquet`) EXCEPT ALL (select r_name
as name from cp.`tpch/region.parquet`)");
+  }
+
+  @Test(expected = RpcException.class) // see DRILL-1921
+  public void testDisabledExcept() throws Exception {
+    test("(select n_name as name from cp.`tpch/nation.parquet`) EXCEPT (select r_name as
name from cp.`tpch/region.parquet`)");
+  }
+
+  @Test(expected = RpcException.class) // see DRILL-1921
+  public void testDisabledNaturalJoin() throws Exception {
+    test("select * from cp.`tpch/nation.parquet` NATURAL JOIN cp.`tpch/region.parquet`");
+  }
+
+  @Test(expected = RpcException.class) // see DRILL-1921
+  public void testDisabledCrossJoin() throws Exception {
+    test("select * from cp.`tpch/nation.parquet` CROSS JOIN cp.`tpch/region.parquet`");
+  }
+
+  @Test(expected = RpcException.class) // see DRILL-1959
+  public void testDisabledCastTINYINT() throws Exception {
+    test("select cast(n_name as tinyint) from cp.`tpch/nation.parquet`;");
+  }
+
+  @Test(expected = RpcException.class) // see DRILL-1959
+  public void testDisabledCastSMALLINT() throws Exception {
+    test("select cast(n_name as smallint) from cp.`tpch/nation.parquet`;");
+  }
+
+  @Test(expected = RpcException.class) // see DRILL-1959
+  public void testDisabledCastREAL() throws Exception {
+    test("select cast(n_name as real) from cp.`tpch/nation.parquet`;");
+  }
+
+  @Test(expected = RpcException.class) // see DRILL-2115
+  public void testDisabledCardinality() throws Exception {
+    test("select cardinality(employee_id) from cp.`employee.json`;");
+  }
+}
\ No newline at end of file


Mime
View raw message