Github user vvysotskyi commented on a diff in the pull request:
https://github.com/apache/drill/pull/1242#discussion_r185458392
--- Diff:
exec/java-exec/src/test/java/org/apache/drill/exec/expr/fn/impl/TestTypeFns.java
---
@@ -0,0 +1,196 @@
+/*
+ * 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.expr.fn.impl;
+
+import static org.junit.Assert.assertEquals;
+
+import org.apache.drill.exec.rpc.RpcException;
+import org.apache.drill.test.ClusterFixture;
+import org.apache.drill.test.ClusterFixtureBuilder;
+import org.apache.drill.test.ClusterTest;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+public class TestTypeFns extends ClusterTest {
+
+ @BeforeClass
+ public static void setup() throws Exception {
+ // Use the following three lines if you add a function
+ // to avoid the need for a full Drill build.
+ ClusterFixtureBuilder builder = ClusterFixture.builder(dirTestWatcher)
+ .configProperty("drill.classpath.scanning.cache.enabled", false);
+ startCluster(builder);
+
+ // Use the following line if a full Drill build has been
+ // done since adding new functions.
+//
startCluster(ClusterFixture.builder(dirTestWatcher).maxParallelization(1));
+ }
+
+ @Test
+ public void testTypeOf() throws RpcException {
+ // SMALLINT not supported in CAST
+ //doTypeOfTest("SMALLINT");
+ doTypeOfTest("INT");
+ doTypeOfTest("BIGINT");
+ doTypeOfTest("VARCHAR");
+ doTypeOfTest("FLOAT", "FLOAT4");
+ doTypeOfTest("DOUBLE", "FLOAT8");
+ doTypeOfTestSpecial("a", "true", "BIT");
+ doTypeOfTestSpecial("a", "CURRENT_DATE", "DATE");
+ doTypeOfTestSpecial("a", "CURRENT_TIME", "TIME");
+ doTypeOfTestSpecial("a", "CURRENT_TIMESTAMP", "TIMESTAMP");
+ doTypeOfTestSpecial("a", "AGE(CURRENT_TIMESTAMP)", "INTERVAL");
+ doTypeOfTestSpecial("BINARY_STRING(a)", "'\\xde\\xad\\xbe\\xef'",
"VARBINARY");
+ try {
+ client.alterSession("planner.enable_decimal_data_type", true);
--- End diff --
Please replace `planner.enable_decimal_data_type` with
`PlannerSettings.ENABLE_DECIMAL_DATA_TYPE_KEY`
---