DRILL-1098: Add test for trim(), substring() function.
Actual fix is in OPTIQ-331


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

Branch: refs/heads/master
Commit: cd4f7267de975f89aef775860532d49220ee8e88
Parents: dcc94a3
Author: Mehant Baid <[email protected]>
Authored: Thu Jul 3 00:09:17 2014 -0700
Committer: Jacques Nadeau <[email protected]>
Committed: Mon Jul 7 14:50:31 2014 -0700

----------------------------------------------------------------------
 .../org/apache/drill/jdbc/test/TestFunctionsQuery.java   | 11 +++++++++++
 1 file changed, 11 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-drill/blob/cd4f7267/exec/jdbc/src/test/java/org/apache/drill/jdbc/test/TestFunctionsQuery.java
----------------------------------------------------------------------
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 9337f61..99c85e5 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");
+  }
 }

Reply via email to