[jira] [Commented] (DRILL-5424) Fix IOBE for reverse function
[ https://issues.apache.org/jira/browse/DRILL-5424?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15972277#comment-15972277 ] Volodymyr Vysotskyi commented on DRILL-5424: Fixed in [72903d0|https://github.com/apache/drill/commit/72903d01424139057d4309ce6655e0aecee2573e] > Fix IOBE for reverse function > - > > Key: DRILL-5424 > URL: https://issues.apache.org/jira/browse/DRILL-5424 > Project: Apache Drill > Issue Type: Bug > Components: Functions - Drill >Affects Versions: 1.9.0 >Reporter: Volodymyr Vysotskyi >Assignee: Volodymyr Vysotskyi >Priority: Minor > Fix For: 1.11.0 > > > Query with reverse function fails: > {code:sql} > 0: jdbc:drill:zk=local> select reverse(a) from dfs.`/tmp/test.json`; > Error: SYSTEM ERROR: IndexOutOfBoundsException: index: 259, length: 1 > (expected: range(0, 256)) > {code} > for table with several long varchars. > {noformat} > cat /tmp/test.json > {"a": "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz"} > {"a": "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz"} > {"a": "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz"} > {"a": "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz"} > {"a": "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz"} > {noformat} > The same query works for the table with less row number: > {code:sql} > 0: jdbc:drill:zk=local> select reverse(a) from dfs.`/tmp/test2.json`; > +---+ > |EXPR$0 | > +---+ > | zyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcba | > | zyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcba | > | zyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcba | > | zyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcba | > +---+ > {code} > {noformat} > cat /tmp/test2.json > {"a": "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz"} > {"a": "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz"} > {"a": "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz"} > {"a": "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz"} > {noformat} -- This message was sent by Atlassian JIRA (v6.3.15#6346)
[jira] [Commented] (DRILL-5424) Fix IOBE for reverse function
[ https://issues.apache.org/jira/browse/DRILL-5424?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15970690#comment-15970690 ] ASF GitHub Bot commented on DRILL-5424: --- Github user asfgit closed the pull request at: https://github.com/apache/drill/pull/815 > Fix IOBE for reverse function > - > > Key: DRILL-5424 > URL: https://issues.apache.org/jira/browse/DRILL-5424 > Project: Apache Drill > Issue Type: Bug > Components: Functions - Drill >Affects Versions: 1.9.0 >Reporter: Volodymyr Vysotskyi >Assignee: Volodymyr Vysotskyi >Priority: Minor > Labels: ready-to-commit > Fix For: 1.11.0 > > > Query with reverse function fails: > {code:sql} > 0: jdbc:drill:zk=local> select reverse(a) from dfs.`/tmp/test.json`; > Error: SYSTEM ERROR: IndexOutOfBoundsException: index: 259, length: 1 > (expected: range(0, 256)) > {code} > for table with several long varchars. > {noformat} > cat /tmp/test.json > {"a": "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz"} > {"a": "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz"} > {"a": "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz"} > {"a": "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz"} > {"a": "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz"} > {noformat} > The same query works for the table with less row number: > {code:sql} > 0: jdbc:drill:zk=local> select reverse(a) from dfs.`/tmp/test2.json`; > +---+ > |EXPR$0 | > +---+ > | zyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcba | > | zyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcba | > | zyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcba | > | zyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcba | > +---+ > {code} > {noformat} > cat /tmp/test2.json > {"a": "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz"} > {"a": "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz"} > {"a": "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz"} > {"a": "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz"} > {noformat} -- This message was sent by Atlassian JIRA (v6.3.15#6346)
[jira] [Commented] (DRILL-5424) Fix IOBE for reverse function
[ https://issues.apache.org/jira/browse/DRILL-5424?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15967711#comment-15967711 ] ASF GitHub Bot commented on DRILL-5424: --- Github user arina-ielchiieva commented on the issue: https://github.com/apache/drill/pull/815 +1 > Fix IOBE for reverse function > - > > Key: DRILL-5424 > URL: https://issues.apache.org/jira/browse/DRILL-5424 > Project: Apache Drill > Issue Type: Bug > Components: Functions - Drill >Affects Versions: 1.9.0 >Reporter: Volodymyr Vysotskyi >Assignee: Volodymyr Vysotskyi >Priority: Minor > > Query with reverse function fails: > {code:sql} > 0: jdbc:drill:zk=local> select reverse(a) from dfs.`/tmp/test.json`; > Error: SYSTEM ERROR: IndexOutOfBoundsException: index: 259, length: 1 > (expected: range(0, 256)) > {code} > for table with several long varchars. > {noformat} > cat /tmp/test.json > {"a": "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz"} > {"a": "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz"} > {"a": "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz"} > {"a": "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz"} > {"a": "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz"} > {noformat} > The same query works for the table with less row number: > {code:sql} > 0: jdbc:drill:zk=local> select reverse(a) from dfs.`/tmp/test2.json`; > +---+ > |EXPR$0 | > +---+ > | zyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcba | > | zyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcba | > | zyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcba | > | zyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcba | > +---+ > {code} > {noformat} > cat /tmp/test2.json > {"a": "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz"} > {"a": "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz"} > {"a": "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz"} > {"a": "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz"} > {noformat} -- This message was sent by Atlassian JIRA (v6.3.15#6346)
[jira] [Commented] (DRILL-5424) Fix IOBE for reverse function
[ https://issues.apache.org/jira/browse/DRILL-5424?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15967587#comment-15967587 ] ASF GitHub Bot commented on DRILL-5424: --- Github user vvysotskyi commented on a diff in the pull request: https://github.com/apache/drill/pull/815#discussion_r111389438 --- Diff: exec/java-exec/src/test/java/org/apache/drill/exec/expr/fn/impl/TestStringFunctions.java --- @@ -273,4 +273,13 @@ public void testSplit() throws Exception { .run(); } + @Test + public void testReverse() throws Exception { +testBuilder() + .sqlQuery("select reverse(reverse(n_comment)) words from cp.`tpch/nation.parquet`") + .unOrdered() + .sqlBaselineQuery("select n_comment words from cp.`tpch/nation.parquet`") + .build() + .run(); + } --- End diff -- Thanks, added these both tests. > Fix IOBE for reverse function > - > > Key: DRILL-5424 > URL: https://issues.apache.org/jira/browse/DRILL-5424 > Project: Apache Drill > Issue Type: Bug > Components: Functions - Drill >Affects Versions: 1.9.0 >Reporter: Volodymyr Vysotskyi >Assignee: Volodymyr Vysotskyi >Priority: Minor > > Query with reverse function fails: > {code:sql} > 0: jdbc:drill:zk=local> select reverse(a) from dfs.`/tmp/test.json`; > Error: SYSTEM ERROR: IndexOutOfBoundsException: index: 259, length: 1 > (expected: range(0, 256)) > {code} > for table with several long varchars. > {noformat} > cat /tmp/test.json > {"a": "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz"} > {"a": "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz"} > {"a": "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz"} > {"a": "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz"} > {"a": "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz"} > {noformat} > The same query works for the table with less row number: > {code:sql} > 0: jdbc:drill:zk=local> select reverse(a) from dfs.`/tmp/test2.json`; > +---+ > |EXPR$0 | > +---+ > | zyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcba | > | zyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcba | > | zyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcba | > | zyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcba | > +---+ > {code} > {noformat} > cat /tmp/test2.json > {"a": "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz"} > {"a": "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz"} > {"a": "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz"} > {"a": "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz"} > {noformat} -- This message was sent by Atlassian JIRA (v6.3.15#6346)
[jira] [Commented] (DRILL-5424) Fix IOBE for reverse function
[ https://issues.apache.org/jira/browse/DRILL-5424?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15966127#comment-15966127 ] ASF GitHub Bot commented on DRILL-5424: --- Github user arina-ielchiieva commented on a diff in the pull request: https://github.com/apache/drill/pull/815#discussion_r92811 --- Diff: exec/java-exec/src/test/java/org/apache/drill/exec/expr/fn/impl/TestStringFunctions.java --- @@ -273,4 +273,13 @@ public void testSplit() throws Exception { .run(); } + @Test + public void testReverse() throws Exception { +testBuilder() + .sqlQuery("select reverse(reverse(n_comment)) words from cp.`tpch/nation.parquet`") + .unOrdered() + .sqlBaselineQuery("select n_comment words from cp.`tpch/nation.parquet`") + .build() + .run(); + } --- End diff -- Unfortunately this unit test does not ensure that reverse function works correctly. Let's replace this unit test with two unit tests: 1. test reverse result for one row like in `testSplit()` test. 2. test that reverse doesn't fail for table with several long varchars. > Fix IOBE for reverse function > - > > Key: DRILL-5424 > URL: https://issues.apache.org/jira/browse/DRILL-5424 > Project: Apache Drill > Issue Type: Bug > Components: Functions - Drill >Affects Versions: 1.9.0 >Reporter: Volodymyr Vysotskyi >Assignee: Volodymyr Vysotskyi >Priority: Minor > > Query with reverse function fails: > {code:sql} > 0: jdbc:drill:zk=local> select reverse(a) from dfs.`/tmp/test.json`; > Error: SYSTEM ERROR: IndexOutOfBoundsException: index: 259, length: 1 > (expected: range(0, 256)) > {code} > for table with several long varchars. > {noformat} > cat /tmp/test.json > {"a": "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz"} > {"a": "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz"} > {"a": "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz"} > {"a": "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz"} > {"a": "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz"} > {noformat} > The same query works for the table with less row number: > {code:sql} > 0: jdbc:drill:zk=local> select reverse(a) from dfs.`/tmp/test2.json`; > +---+ > |EXPR$0 | > +---+ > | zyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcba | > | zyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcba | > | zyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcba | > | zyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcba | > +---+ > {code} > {noformat} > cat /tmp/test2.json > {"a": "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz"} > {"a": "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz"} > {"a": "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz"} > {"a": "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz"} > {noformat} -- This message was sent by Atlassian JIRA (v6.3.15#6346)
[jira] [Commented] (DRILL-5424) Fix IOBE for reverse function
[ https://issues.apache.org/jira/browse/DRILL-5424?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15964447#comment-15964447 ] ASF GitHub Bot commented on DRILL-5424: --- GitHub user vvysotskyi opened a pull request: https://github.com/apache/drill/pull/815 DRILL-5424: Fix IOBE for reverse function You can merge this pull request into a Git repository by running: $ git pull https://github.com/vvysotskyi/drill DRILL-5424 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/drill/pull/815.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #815 commit 8e420a9c4675c672f6a06c8bd7e8e48c0ce1ef40 Author: Volodymyr VysotskyiDate: 2017-04-10T13:16:52Z DRILL-5424: Fix IOBE for reverse function > Fix IOBE for reverse function > - > > Key: DRILL-5424 > URL: https://issues.apache.org/jira/browse/DRILL-5424 > Project: Apache Drill > Issue Type: Bug > Components: Functions - Drill >Affects Versions: 1.9.0 >Reporter: Volodymyr Vysotskyi >Assignee: Volodymyr Vysotskyi >Priority: Minor > > Query with reverse function fails: > {code:sql} > 0: jdbc:drill:zk=local> select reverse(a) from dfs.`/tmp/test.json`; > Error: SYSTEM ERROR: IndexOutOfBoundsException: index: 259, length: 1 > (expected: range(0, 256)) > {code} > for table with several long varchars. > {noformat} > cat /tmp/test.json > {"a": "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz"} > {"a": "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz"} > {"a": "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz"} > {"a": "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz"} > {"a": "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz"} > {noformat} > The same query works for the table with less row number: > {code:sql} > 0: jdbc:drill:zk=local> select reverse(a) from dfs.`/tmp/test2.json`; > +---+ > |EXPR$0 | > +---+ > | zyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcba | > | zyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcba | > | zyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcba | > | zyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcba | > +---+ > {code} > {noformat} > cat /tmp/test2.json > {"a": "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz"} > {"a": "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz"} > {"a": "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz"} > {"a": "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz"} > {noformat} -- This message was sent by Atlassian JIRA (v6.3.15#6346)