aboutsummaryrefslogtreecommitdiff
path: root/exec/jdbc
diff options
context:
space:
mode:
authorMehant Baid <mehantr@gmail.com>2014-07-03 00:09:17 -0700
committerJacques Nadeau <jacques@apache.org>2014-07-07 14:50:31 -0700
commitcd4f7267de975f89aef775860532d49220ee8e88 (patch)
tree5ffcd6c4fa1b688589671e25dfee2ceb6c475578 /exec/jdbc
parentdcc94a3980498761f81d8e87cc04097ebcfdb3f7 (diff)
DRILL-1098: Add test for trim(), substring() function.
Actual fix is in OPTIQ-331
Diffstat (limited to 'exec/jdbc')
-rw-r--r--exec/jdbc/src/test/java/org/apache/drill/jdbc/test/TestFunctionsQuery.java11
1 files changed, 11 insertions, 0 deletions
diff --git a/exec/jdbc/src/test/java/org/apache/drill/jdbc/test/TestFunctionsQuery.java b/exec/jdbc/src/test/java/org/apache/drill/jdbc/test/TestFunctionsQuery.java
index 9337f6108..99c85e526 100644
--- a/exec/jdbc/src/test/java/org/apache/drill/jdbc/test/TestFunctionsQuery.java
+++ b/exec/jdbc/src/test/java/org/apache/drill/jdbc/test/TestFunctionsQuery.java
@@ -690,4 +690,15 @@ public class TestFunctionsQuery {
.returns(
"NEG=-2\n");
}
+
+ @Test
+ public void testOptiqValidationFunctions() throws Exception {
+ String query = "select trim(first_name) as TRIM_STR, substring(first_name, 2) as SUB_STR " +
+ "from cp.`employee.json` where employee_id = 1";
+
+ JdbcAssert.withNoDefaultSchema()
+ .sql(query)
+ .returns("TRIM_STR=Sheri; "+
+ "SUB_STR=heri\n");
+ }
}