You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@drill.apache.org by ja...@apache.org on 2014/03/18 06:03:11 UTC
[2/3] Drill-379: support part of string and math functions
http://git-wip-us.apache.org/repos/asf/incubator-drill/blob/24134072/exec/java-exec/src/test/resources/functions/string/testCharLength.json
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/test/resources/functions/string/testCharLength.json b/exec/java-exec/src/test/resources/functions/string/testCharLength.json
new file mode 100644
index 0000000..00d1a3b
--- /dev/null
+++ b/exec/java-exec/src/test/resources/functions/string/testCharLength.json
@@ -0,0 +1,46 @@
+{
+ head:{
+ type:"APACHE_DRILL_PHYSICAL",
+ version:"1",
+ generator:{
+ type:"manual"
+ }
+ },
+ graph:[
+ {
+ @id:1,
+ pop:"mock-sub-scan",
+ url: "http://apache.org",
+ entries:[
+ {records: 1, types: [
+ {name: "varcharcol", type: "VARCHAR", mode: "REQUIRED"},
+ {name: "nullvarcharcol", type: "VARCHAR", mode: "OPTIONAL"}
+ ]}
+ ]
+ },
+ {
+ @id:2,
+ child: 1,
+ pop:"project",
+ exprs: [
+ { ref: "col1", expr: "char_length(\"aababcdf\")"},
+ { ref: "col2", expr: "char_length(\"\")"},
+ { ref: "col3", expr: "char_length(varcharcol)"},
+ { ref: "col4", expr: "char_length(nullvarcharcol)"},
+ { ref: "col5", expr: "character_length(\"aababcdf\")"},
+ { ref: "col6", expr: "character_length(\"\")"},
+ { ref: "col7", expr: "character_length(varcharcol)"},
+ { ref: "col8", expr: "character_length(nullvarcharcol)"},
+ { ref: "col9", expr: "length(\"aababcdf\")"},
+ { ref: "col10", expr: "length(\"\")"},
+ { ref: "col11", expr: "length(varcharcol)"},
+ { ref: "col12", expr: "length(nullvarcharcol)"}
+ ]
+ },
+ {
+ @id: 3,
+ child: 2,
+ pop: "screen"
+ }
+ ]
+}
http://git-wip-us.apache.org/repos/asf/incubator-drill/blob/24134072/exec/java-exec/src/test/resources/functions/string/testConcat.json
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/test/resources/functions/string/testConcat.json b/exec/java-exec/src/test/resources/functions/string/testConcat.json
new file mode 100644
index 0000000..ccefdd0
--- /dev/null
+++ b/exec/java-exec/src/test/resources/functions/string/testConcat.json
@@ -0,0 +1,38 @@
+{
+ head:{
+ type:"APACHE_DRILL_PHYSICAL",
+ version:"1",
+ generator:{
+ type:"manual"
+ }
+ },
+ graph:[
+ {
+ @id:1,
+ pop:"mock-sub-scan",
+ url: "http://apache.org",
+ entries:[
+ {records: 1, types: [
+ {name: "varcharcol", type: "VARCHAR", mode: "REQUIRED"},
+ {name: "nullvarcharcol", type: "VARCHAR", mode: "OPTIONAL"}
+ ]}
+ ]
+ },
+ {
+ @id:2,
+ child: 1,
+ pop:"project",
+ exprs: [
+ { ref: "col1", expr: "concat(\"abc\", \"ABC\")"},
+ { ref: "col2", expr: "concat(\"abc\", \"\")"},
+ { ref: "col3", expr: "concat(\"\", \"ABC\")"},
+ { ref: "col4", expr: "concat(\"\", \"\")"}
+ ]
+ },
+ {
+ @id: 3,
+ child: 2,
+ pop: "screen"
+ }
+ ]
+}
http://git-wip-us.apache.org/repos/asf/incubator-drill/blob/24134072/exec/java-exec/src/test/resources/functions/string/testLeft.json
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/test/resources/functions/string/testLeft.json b/exec/java-exec/src/test/resources/functions/string/testLeft.json
new file mode 100644
index 0000000..e043df5
--- /dev/null
+++ b/exec/java-exec/src/test/resources/functions/string/testLeft.json
@@ -0,0 +1,41 @@
+{
+ head:{
+ type:"APACHE_DRILL_PHYSICAL",
+ version:"1",
+ generator:{
+ type:"manual"
+ }
+ },
+ graph:[
+ {
+ @id:1,
+ pop:"mock-sub-scan",
+ url: "http://apache.org",
+ entries:[
+ {records: 1, types: [
+ {name: "varcharcol", type: "VARCHAR", mode: "REQUIRED"},
+ {name: "nullvarcharcol", type: "VARCHAR", mode: "OPTIONAL"}
+ ]}
+ ]
+ },
+ {
+ @id:2,
+ child: 1,
+ pop:"project",
+ exprs: [
+ { ref: "col1", expr: "left(\"abcdef\", 2)"},
+ { ref: "col2", expr: "left(\"abcdef\", 6)"},
+ { ref: "col3", expr: "left(\"abcdef\", 7)"},
+ { ref: "col4", expr: "left(\"abcdef\", -2)"},
+ { ref: "col5", expr: "left(\"abcdef\", -5)"},
+ { ref: "col6", expr: "left(\"abcdef\", -6)"},
+ { ref: "col7", expr: "left(\"abcdef\", -7)"}
+ ]
+ },
+ {
+ @id: 3,
+ child: 2,
+ pop: "screen"
+ }
+ ]
+}
http://git-wip-us.apache.org/repos/asf/incubator-drill/blob/24134072/exec/java-exec/src/test/resources/functions/string/testLike.json
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/test/resources/functions/string/testLike.json b/exec/java-exec/src/test/resources/functions/string/testLike.json
new file mode 100644
index 0000000..92b501c
--- /dev/null
+++ b/exec/java-exec/src/test/resources/functions/string/testLike.json
@@ -0,0 +1,38 @@
+{
+ head:{
+ type:"APACHE_DRILL_PHYSICAL",
+ version:"1",
+ generator:{
+ type:"manual"
+ }
+ },
+ graph:[
+ {
+ @id:1,
+ pop:"mock-sub-scan",
+ url: "http://apache.org",
+ entries:[
+ {records: 1, types: [
+ {name: "varcharcol", type: "VARCHAR", mode: "REQUIRED"},
+ {name: "nullvarcharcol", type: "VARCHAR", mode: "OPTIONAL"}
+ ]}
+ ]
+ },
+ {
+ @id:2,
+ child: 1,
+ pop:"project",
+ exprs: [
+ { ref: "islike", expr:" like(\"abc\", \"abc\")" },
+ { ref: "islike", expr:" like(\"abc\", \"a%\")" },
+ { ref: "islike", expr:" like(\"abc\", \"_b_\")" },
+ { ref: "islike", expr:" like(\"abc\", \"c\")" }
+ ]
+ },
+ {
+ @id: 3,
+ child: 2,
+ pop: "screen"
+ }
+ ]
+}
http://git-wip-us.apache.org/repos/asf/incubator-drill/blob/24134072/exec/java-exec/src/test/resources/functions/string/testLower.json
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/test/resources/functions/string/testLower.json b/exec/java-exec/src/test/resources/functions/string/testLower.json
new file mode 100644
index 0000000..5e10920
--- /dev/null
+++ b/exec/java-exec/src/test/resources/functions/string/testLower.json
@@ -0,0 +1,37 @@
+{
+ head:{
+ type:"APACHE_DRILL_PHYSICAL",
+ version:"1",
+ generator:{
+ type:"manual"
+ }
+ },
+ graph:[
+ {
+ @id:1,
+ pop:"mock-sub-scan",
+ url: "http://apache.org",
+ entries:[
+ {records: 1, types: [
+ {name: "varcharcol", type: "VARCHAR", mode: "REQUIRED"},
+ {name: "nullvarcharcol", type: "VARCHAR", mode: "OPTIONAL"}
+ ]}
+ ]
+ },
+ {
+ @id:2,
+ child: 1,
+ pop:"project",
+ exprs: [
+ { ref: "lower", expr: "lower(\"ABcEFgh\")"},
+ { ref: "lower", expr: "lower(\"aBc\")"},
+ { ref: "lower", expr: "lower(\"\")"}
+ ]
+ },
+ {
+ @id: 3,
+ child: 2,
+ pop: "screen"
+ }
+ ]
+}
http://git-wip-us.apache.org/repos/asf/incubator-drill/blob/24134072/exec/java-exec/src/test/resources/functions/string/testLpad.json
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/test/resources/functions/string/testLpad.json b/exec/java-exec/src/test/resources/functions/string/testLpad.json
new file mode 100644
index 0000000..071acfe
--- /dev/null
+++ b/exec/java-exec/src/test/resources/functions/string/testLpad.json
@@ -0,0 +1,45 @@
+{
+ head:{
+ type:"APACHE_DRILL_PHYSICAL",
+ version:"1",
+ generator:{
+ type:"manual"
+ }
+ },
+ graph:[
+ {
+ @id:1,
+ pop:"mock-sub-scan",
+ url: "http://apache.org",
+ entries:[
+ {records: 1, types: [
+ {name: "varcharcol", type: "VARCHAR", mode: "REQUIRED"},
+ {name: "nullvarcharcol", type: "VARCHAR", mode: "OPTIONAL"}
+ ]}
+ ]
+ },
+ {
+ @id:2,
+ child: 1,
+ pop:"project",
+ exprs: [
+ { ref: "col1", expr: "lpad(\"abcdef\", 0, \"abc\")"},
+ { ref: "col2", expr: "lpad(\"abcdef\", -3, \"abc\")"},
+ { ref: "col3", expr: "lpad(\"abcdef\", 6, \"abc\")"},
+ { ref: "col4", expr: "lpad(\"abcdef\", 2, \"abc\")"},
+ { ref: "col5", expr: "lpad(\"abcdef\", 2, \"\")"},
+ { ref: "col7", expr: "lpad(\"abcdef\", 10, \"\")"},
+ { ref: "col8", expr: "lpad(\"abcdef\", 10, \"A\")"},
+ { ref: "col9", expr: "lpad(\"abcdef\", 10, \"AB\")"},
+ { ref: "col10", expr: "lpad(\"abcdef\", 10, \"ABC\")"},
+ { ref: "col11", expr: "lpad(\"abcdef\", 10, \"ABCDEFGHIJKLMN\")"}
+
+ ]
+ },
+ {
+ @id: 3,
+ child: 2,
+ pop: "screen"
+ }
+ ]
+}
http://git-wip-us.apache.org/repos/asf/incubator-drill/blob/24134072/exec/java-exec/src/test/resources/functions/string/testLtrim.json
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/test/resources/functions/string/testLtrim.json b/exec/java-exec/src/test/resources/functions/string/testLtrim.json
new file mode 100644
index 0000000..e1f1a68
--- /dev/null
+++ b/exec/java-exec/src/test/resources/functions/string/testLtrim.json
@@ -0,0 +1,40 @@
+{
+ head:{
+ type:"APACHE_DRILL_PHYSICAL",
+ version:"1",
+ generator:{
+ type:"manual"
+ }
+ },
+ graph:[
+ {
+ @id:1,
+ pop:"mock-sub-scan",
+ url: "http://apache.org",
+ entries:[
+ {records: 1, types: [
+ {name: "varcharcol", type: "VARCHAR", mode: "REQUIRED"},
+ {name: "nullvarcharcol", type: "VARCHAR", mode: "OPTIONAL"}
+ ]}
+ ]
+ },
+ {
+ @id:2,
+ child: 1,
+ pop:"project",
+ exprs: [
+ { ref: "col1", expr: "ltrim(\"abcdef\", \"abc\")"},
+ { ref: "col2", expr: "ltrim(\"abcdef\", \"\")"},
+ { ref: "col3", expr: "ltrim(\"abcdabc\", \"abc\")"},
+ { ref: "col4", expr: "ltrim(\"abc\", \"abc\")"},
+ { ref: "col5", expr: "ltrim(\"\", \"abc\")"},
+ { ref: "col6", expr: "ltrim(\"\", \"\")"}
+ ]
+ },
+ {
+ @id: 3,
+ child: 2,
+ pop: "screen"
+ }
+ ]
+}
http://git-wip-us.apache.org/repos/asf/incubator-drill/blob/24134072/exec/java-exec/src/test/resources/functions/string/testPosition.json
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/test/resources/functions/string/testPosition.json b/exec/java-exec/src/test/resources/functions/string/testPosition.json
new file mode 100644
index 0000000..8abeeae
--- /dev/null
+++ b/exec/java-exec/src/test/resources/functions/string/testPosition.json
@@ -0,0 +1,42 @@
+{
+ head:{
+ type:"APACHE_DRILL_PHYSICAL",
+ version:"1",
+ generator:{
+ type:"manual"
+ }
+ },
+ graph:[
+ {
+ @id:1,
+ pop:"mock-sub-scan",
+ url: "http://apache.org",
+ entries:[
+ {records: 1, types: [
+ {name: "varcharcol", type: "VARCHAR", mode: "REQUIRED"},
+ {name: "nullvarcharcol", type: "VARCHAR", mode: "OPTIONAL"}
+ ]}
+ ]
+ },
+ {
+ @id:2,
+ child: 1,
+ pop:"project",
+ exprs: [
+ { ref: "col1", expr: "position(\"abc\", \"AabcabcB\")"},
+ { ref: "col2", expr: "position(\"\", \"AabcabcB\")"},
+ { ref: "col3", expr: "position(\"abc\", \"\")"},
+ { ref: "col4", expr: "position(\"\", \"\")"},
+ { ref: "col5", expr: "strpos(\"AabcabcB\", \"abc\")" },
+ { ref: "col6", expr: "strpos(\"\", \"AabcabcB\")"},
+ { ref: "col7", expr: "strpos(\"\", \"abc\")"},
+ { ref: "col8", expr: "strpos(\"\", \"\")"}
+ ]
+ },
+ {
+ @id: 3,
+ child: 2,
+ pop: "screen"
+ }
+ ]
+}
http://git-wip-us.apache.org/repos/asf/incubator-drill/blob/24134072/exec/java-exec/src/test/resources/functions/string/testRegexpReplace.json
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/test/resources/functions/string/testRegexpReplace.json b/exec/java-exec/src/test/resources/functions/string/testRegexpReplace.json
new file mode 100644
index 0000000..3e3874a
--- /dev/null
+++ b/exec/java-exec/src/test/resources/functions/string/testRegexpReplace.json
@@ -0,0 +1,38 @@
+{
+ head:{
+ type:"APACHE_DRILL_PHYSICAL",
+ version:"1",
+ generator:{
+ type:"manual"
+ }
+ },
+ graph:[
+ {
+ @id:1,
+ pop:"mock-sub-scan",
+ url: "http://apache.org",
+ entries:[
+ {records: 1, types: [
+ {name: "varcharcol", type: "VARCHAR", mode: "REQUIRED"},
+ {name: "nullvarcharcol", type: "VARCHAR", mode: "OPTIONAL"}
+ ]}
+ ]
+ },
+ {
+ @id:2,
+ child: 1,
+ pop:"project",
+ exprs: [
+ { ref: "col1", expr: "regexp_replace(\"Thomas\", \".[mN]a.\", \"M\")" },
+ { ref: "col1", expr: "regexp_replace(\"Thomas\", \".[mN]a.\", \"\")" },
+ { ref: "col1", expr: "regexp_replace(\"Thomas\", \"ef\", \"AB\")" }
+
+ ]
+ },
+ {
+ @id: 3,
+ child: 2,
+ pop: "screen"
+ }
+ ]
+}
http://git-wip-us.apache.org/repos/asf/incubator-drill/blob/24134072/exec/java-exec/src/test/resources/functions/string/testReplace.json
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/test/resources/functions/string/testReplace.json b/exec/java-exec/src/test/resources/functions/string/testReplace.json
new file mode 100644
index 0000000..4041dd4
--- /dev/null
+++ b/exec/java-exec/src/test/resources/functions/string/testReplace.json
@@ -0,0 +1,40 @@
+{
+ head:{
+ type:"APACHE_DRILL_PHYSICAL",
+ version:"1",
+ generator:{
+ type:"manual"
+ }
+ },
+ graph:[
+ {
+ @id:1,
+ pop:"mock-sub-scan",
+ url: "http://apache.org",
+ entries:[
+ {records: 1, types: [
+ {name: "varcharcol", type: "VARCHAR", mode: "REQUIRED"},
+ {name: "nullvarcharcol", type: "VARCHAR", mode: "OPTIONAL"}
+ ]}
+ ]
+ },
+ {
+ @id:2,
+ child: 1,
+ pop:"project",
+ exprs: [
+ { ref: "col1", expr: "replace(\"aababcdf\", \"ab\", \"AB\")"},
+ { ref: "col2", expr: "replace(\"aababcdf\", \"a\", \"AB\")"},
+ { ref: "col3", expr: "replace(\"aababcdf\", \"\", \"AB\")"},
+ { ref: "col4", expr: "replace(\"aababcdf\", \"ab\", \"\")"},
+ { ref: "col5", expr: "replace(\"abc\", \"abc\", \"ABCD\")"},
+ { ref: "col6", expr: "replace(\"abc\", \"abcdefg\", \"ABCD\")"}
+ ]
+ },
+ {
+ @id: 3,
+ child: 2,
+ pop: "screen"
+ }
+ ]
+}
http://git-wip-us.apache.org/repos/asf/incubator-drill/blob/24134072/exec/java-exec/src/test/resources/functions/string/testRight.json
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/test/resources/functions/string/testRight.json b/exec/java-exec/src/test/resources/functions/string/testRight.json
new file mode 100644
index 0000000..db5a5a5
--- /dev/null
+++ b/exec/java-exec/src/test/resources/functions/string/testRight.json
@@ -0,0 +1,41 @@
+{
+ head:{
+ type:"APACHE_DRILL_PHYSICAL",
+ version:"1",
+ generator:{
+ type:"manual"
+ }
+ },
+ graph:[
+ {
+ @id:1,
+ pop:"mock-sub-scan",
+ url: "http://apache.org",
+ entries:[
+ {records: 1, types: [
+ {name: "varcharcol", type: "VARCHAR", mode: "REQUIRED"},
+ {name: "nullvarcharcol", type: "VARCHAR", mode: "OPTIONAL"}
+ ]}
+ ]
+ },
+ {
+ @id:2,
+ child: 1,
+ pop:"project",
+ exprs: [
+ { ref: "col1", expr: "right(\"abcdef\", 2)"},
+ { ref: "col2", expr: "right(\"abcdef\", 6)"},
+ { ref: "col3", expr: "right(\"abcdef\", 7)"},
+ { ref: "col4", expr: "right(\"abcdef\", -2)"},
+ { ref: "col5", expr: "right(\"abcdef\", -5)"},
+ { ref: "col6", expr: "right(\"abcdef\", -6)"},
+ { ref: "col7", expr: "right(\"abcdef\", -7)"}
+ ]
+ },
+ {
+ @id: 3,
+ child: 2,
+ pop: "screen"
+ }
+ ]
+}
http://git-wip-us.apache.org/repos/asf/incubator-drill/blob/24134072/exec/java-exec/src/test/resources/functions/string/testRpad.json
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/test/resources/functions/string/testRpad.json b/exec/java-exec/src/test/resources/functions/string/testRpad.json
new file mode 100644
index 0000000..18f34d9
--- /dev/null
+++ b/exec/java-exec/src/test/resources/functions/string/testRpad.json
@@ -0,0 +1,45 @@
+{
+ head:{
+ type:"APACHE_DRILL_PHYSICAL",
+ version:"1",
+ generator:{
+ type:"manual"
+ }
+ },
+ graph:[
+ {
+ @id:1,
+ pop:"mock-sub-scan",
+ url: "http://apache.org",
+ entries:[
+ {records: 1, types: [
+ {name: "varcharcol", type: "VARCHAR", mode: "REQUIRED"},
+ {name: "nullvarcharcol", type: "VARCHAR", mode: "OPTIONAL"}
+ ]}
+ ]
+ },
+ {
+ @id:2,
+ child: 1,
+ pop:"project",
+ exprs: [
+ { ref: "col1", expr: "rpad(\"abcdef\", 0, \"abc\")"},
+ { ref: "col2", expr: "rpad(\"abcdef\", -3, \"abc\")"},
+ { ref: "col3", expr: "rpad(\"abcdef\", 6, \"abc\")"},
+ { ref: "col4", expr: "rpad(\"abcdef\", 2, \"abc\")"},
+ { ref: "col5", expr: "rpad(\"abcdef\", 2, \"\")"},
+ { ref: "col7", expr: "rpad(\"abcdef\", 10, \"\")"},
+ { ref: "col8", expr: "rpad(\"abcdef\", 10, \"A\")"},
+ { ref: "col9", expr: "rpad(\"abcdef\", 10, \"AB\")"},
+ { ref: "col10", expr: "rpad(\"abcdef\", 10, \"ABC\")"},
+ { ref: "col11", expr: "rpad(\"abcdef\", 10, \"ABCDEFGHIJKLMN\")"}
+
+ ]
+ },
+ {
+ @id: 3,
+ child: 2,
+ pop: "screen"
+ }
+ ]
+}
http://git-wip-us.apache.org/repos/asf/incubator-drill/blob/24134072/exec/java-exec/src/test/resources/functions/string/testRtrim.json
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/test/resources/functions/string/testRtrim.json b/exec/java-exec/src/test/resources/functions/string/testRtrim.json
new file mode 100644
index 0000000..414534a
--- /dev/null
+++ b/exec/java-exec/src/test/resources/functions/string/testRtrim.json
@@ -0,0 +1,40 @@
+{
+ head:{
+ type:"APACHE_DRILL_PHYSICAL",
+ version:"1",
+ generator:{
+ type:"manual"
+ }
+ },
+ graph:[
+ {
+ @id:1,
+ pop:"mock-sub-scan",
+ url: "http://apache.org",
+ entries:[
+ {records: 1, types: [
+ {name: "varcharcol", type: "VARCHAR", mode: "REQUIRED"},
+ {name: "nullvarcharcol", type: "VARCHAR", mode: "OPTIONAL"}
+ ]}
+ ]
+ },
+ {
+ @id:2,
+ child: 1,
+ pop:"project",
+ exprs: [
+ { ref: "col1", expr: "rtrim(\"abcdef\", \"def\")"},
+ { ref: "col2", expr: "rtrim(\"abcdef\", \"\")"},
+ { ref: "col3", expr: "rtrim(\"ABdabc\", \"abc\")"},
+ { ref: "col4", expr: "rtrim(\"abc\", \"abc\")"},
+ { ref: "col5", expr: "rtrim(\"\", \"abc\")"},
+ { ref: "col6", expr: "rtrim(\"\", \"\")"}
+ ]
+ },
+ {
+ @id: 3,
+ child: 2,
+ pop: "screen"
+ }
+ ]
+}
http://git-wip-us.apache.org/repos/asf/incubator-drill/blob/24134072/exec/java-exec/src/test/resources/functions/string/testSimilar.json
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/test/resources/functions/string/testSimilar.json b/exec/java-exec/src/test/resources/functions/string/testSimilar.json
new file mode 100644
index 0000000..d7f303d
--- /dev/null
+++ b/exec/java-exec/src/test/resources/functions/string/testSimilar.json
@@ -0,0 +1,38 @@
+{
+ head:{
+ type:"APACHE_DRILL_PHYSICAL",
+ version:"1",
+ generator:{
+ type:"manual"
+ }
+ },
+ graph:[
+ {
+ @id:1,
+ pop:"mock-sub-scan",
+ url: "http://apache.org",
+ entries:[
+ {records: 1, types: [
+ {name: "varcharcol", type: "VARCHAR", mode: "REQUIRED"},
+ {name: "nullvarcharcol", type: "VARCHAR", mode: "OPTIONAL"}
+ ]}
+ ]
+ },
+ {
+ @id:2,
+ child: 1,
+ pop:"project",
+ exprs: [
+ { ref: "issimilar", expr:" similar(\"abc\", \"abc\")" },
+ { ref: "issimilar", expr:" similar(\"abc\", \"a\")" },
+ { ref: "issimilar", expr:" similar(\"abc\", \"%(b|d)%\")" },
+ { ref: "issimilar", expr:" similar(\"abc\", \"(b|c)%\")" }
+ ]
+ },
+ {
+ @id: 3,
+ child: 2,
+ pop: "screen"
+ }
+ ]
+}
http://git-wip-us.apache.org/repos/asf/incubator-drill/blob/24134072/exec/java-exec/src/test/resources/functions/string/testSubstr.json
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/test/resources/functions/string/testSubstr.json b/exec/java-exec/src/test/resources/functions/string/testSubstr.json
new file mode 100644
index 0000000..e885381
--- /dev/null
+++ b/exec/java-exec/src/test/resources/functions/string/testSubstr.json
@@ -0,0 +1,42 @@
+{
+ head:{
+ type:"APACHE_DRILL_PHYSICAL",
+ version:"1",
+ generator:{
+ type:"manual"
+ }
+ },
+ graph:[
+ {
+ @id:1,
+ pop:"mock-sub-scan",
+ url: "http://apache.org",
+ entries:[
+ {records: 1, types: [
+ {name: "varcharcol", type: "VARCHAR", mode: "REQUIRED"},
+ {name: "nullvarcharcol", type: "VARCHAR", mode: "OPTIONAL"}
+ ]}
+ ]
+ },
+ {
+ @id:2,
+ child: 1,
+ pop:"project",
+ exprs: [
+ { ref: "col1", expr: "substring('abcdef', 1, 3)"},
+ { ref: "col2", expr: "substring('abcdef', 2, 3)"},
+ { ref: "col3", expr: "substring('abcdef', 2, 5)"},
+ { ref: "col4", expr: "substring('abcdef', 2, 10)"},
+ { ref: "col5", expr: "substring('abcdef', 0, 3)"},
+ { ref: "col6", expr: "substring('abcdef', -1, 3)"},
+ { ref: "col7", expr: "substring('', 1, 2)"},
+ { ref: "col8", expr: "substring('abcdef', 10, 2)"}
+ ]
+ },
+ {
+ @id: 3,
+ child: 2,
+ pop: "screen"
+ }
+ ]
+}
http://git-wip-us.apache.org/repos/asf/incubator-drill/blob/24134072/exec/java-exec/src/test/resources/functions/string/testUpper.json
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/test/resources/functions/string/testUpper.json b/exec/java-exec/src/test/resources/functions/string/testUpper.json
new file mode 100644
index 0000000..5258367
--- /dev/null
+++ b/exec/java-exec/src/test/resources/functions/string/testUpper.json
@@ -0,0 +1,37 @@
+{
+ head:{
+ type:"APACHE_DRILL_PHYSICAL",
+ version:"1",
+ generator:{
+ type:"manual"
+ }
+ },
+ graph:[
+ {
+ @id:1,
+ pop:"mock-sub-scan",
+ url: "http://apache.org",
+ entries:[
+ {records: 1, types: [
+ {name: "varcharcol", type: "VARCHAR", mode: "REQUIRED"},
+ {name: "nullvarcharcol", type: "VARCHAR", mode: "OPTIONAL"}
+ ]}
+ ]
+ },
+ {
+ @id:2,
+ child: 1,
+ pop:"project",
+ exprs: [
+ { ref: "lower", expr: "upper(\"ABcEFgh\")"},
+ { ref: "lower", expr: "upper(\"aBc\")"},
+ { ref: "lower", expr: "upper(\"\")"}
+ ]
+ },
+ {
+ @id: 3,
+ child: 2,
+ pop: "screen"
+ }
+ ]
+}
http://git-wip-us.apache.org/repos/asf/incubator-drill/blob/24134072/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index e0b96fa..c4bc9c9 100644
--- a/pom.xml
+++ b/pom.xml
@@ -211,7 +211,7 @@
<artifactId>maven-surefire-plugin</artifactId>
<version>2.15</version>
<configuration>
- <argLine>-XX:MaxDirectMemorySize=6096M </argLine>
+ <argLine>-Xms1g -Xmx1g -XX:MaxDirectMemorySize=6096M </argLine>
<additionalClasspathElements>
<additionalClasspathElement>./sqlparser/src/test/resources/storage-engines.json</additionalClasspathElement>
</additionalClasspathElements>