[jira] [Created] (DRILL-4904) NPE from backquoted LIKE argument
Boaz Ben-Zvi created DRILL-4904: --- Summary: NPE from backquoted LIKE argument Key: DRILL-4904 URL: https://issues.apache.org/jira/browse/DRILL-4904 Project: Apache Drill Issue Type: Bug Components: Functions - Drill Affects Versions: 1.8.0 Reporter: Boaz Ben-Zvi By mistakenly using backquotes (instead of regular single quotes) in the argument for LIKE, an NPE shows: 0: jdbc:drill:zk=local> select col from test1 where col like `24518133617%` group by col; Error: SYSTEM ERROR: NullPointerException Fragment 3:1 [Error Id: 5c8317c3-3b1c-415b-8967-56696eeff764 on 10.250.57.63:31010] (java.lang.NullPointerException) null org.apache.drill.exec.expr.fn.impl.StringFunctionHelpers.toStringFromUTF8():199 org.apache.drill.exec.test.generated.FiltererGen58.doSetup():84 org.apache.drill.exec.test.generated.FiltererGen58.setup():54 org.apache.drill.exec.physical.impl.filter.FilterRecordBatch.generateSV2Filterer():195 org.apache.drill.exec.physical.impl.filter.FilterRecordBatch.setupNewSchema():107 org.apache.drill.exec.record.AbstractSingleRecordBatch.innerNext():78 org.apache.drill.exec.record.AbstractRecordBatch.next():162 org.apache.drill.exec.record.AbstractRecordBatch.next():119 org.apache.drill.exec.record.AbstractRecordBatch.next():109 org.apache.drill.exec.record.AbstractSingleRecordBatch.innerNext():51 org.apache.drill.exec.physical.impl.svremover.RemovingRecordBatch.innerNext():94 org.apache.drill.exec.record.AbstractRecordBatch.next():162 org.apache.drill.exec.record.AbstractRecordBatch.next():119 org.apache.drill.exec.record.AbstractRecordBatch.next():109 org.apache.drill.exec.record.AbstractSingleRecordBatch.innerNext():51 org.apache.drill.exec.physical.impl.project.ProjectRecordBatch.innerNext():135 org.apache.drill.exec.record.AbstractRecordBatch.next():162 org.apache.drill.exec.record.AbstractRecordBatch.next():119 org.apache.drill.exec.record.AbstractRecordBatch.next():109 org.apache.drill.exec.physical.impl.aggregate.HashAggBatch.buildSchema():97 org.apache.drill.exec.record.AbstractRecordBatch.next():142 org.apache.drill.exec.record.AbstractRecordBatch.next():119 org.apache.drill.exec.record.AbstractRecordBatch.next():109 org.apache.drill.exec.record.AbstractSingleRecordBatch.innerNext():51 org.apache.drill.exec.physical.impl.project.ProjectRecordBatch.innerNext():135 org.apache.drill.exec.record.AbstractRecordBatch.next():162 org.apache.drill.exec.physical.impl.BaseRootExec.next():104 org.apache.drill.exec.physical.impl.SingleSenderCreator$SingleSenderRootExec.innerNext():92 org.apache.drill.exec.physical.impl.BaseRootExec.next():94 org.apache.drill.exec.work.fragment.FragmentExecutor$1.run():232 org.apache.drill.exec.work.fragment.FragmentExecutor$1.run():226 java.security.AccessController.doPrivileged():-2 javax.security.auth.Subject.doAs():422 org.apache.hadoop.security.UserGroupInformation.doAs():1657 org.apache.drill.exec.work.fragment.FragmentExecutor.run():226 org.apache.drill.common.SelfCleaningRunnable.run():38 java.util.concurrent.ThreadPoolExecutor.runWorker():1142 java.util.concurrent.ThreadPoolExecutor$Worker.run():617 java.lang.Thread.run():745 (state=,code=0) More info: Table is json ; single varchar column. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Updated] (DRILL-4903) Implicit columns are shown when Jdbc plugin is enabled
[ https://issues.apache.org/jira/browse/DRILL-4903?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Arina Ielchiieva updated DRILL-4903: Description: When any Jdbc Plugin enabled (ex: MySql) implicit columns are returned as part of select * query. Simple json: {noformat} {id: 1, name: "Bob"} {noformat} When Jdbc plugin is enabled: {noformat} 0: jdbc:drill:zk=local> select * from dfs.`/home/osboxes/files/simple.json`; +--+--+--+-+-+---+ | fqn| filepath | filename | suffix | id | name | +--+--+--+-+-+---+ | /home/osboxes/files/simple.json | /home/osboxes/files | simple.json | json | 1 | Bob | +--+--+--+-+-+---+ 1 row selected (0.203 seconds) 0: jdbc:drill:zk=local> explain plan for select * from dfs.`/home/osboxes/files/simple.json`; +--+--+ | text | json | +--+--+ | 00-00Screen 00-01 Scan(groupscan=[EasyGroupScan [selectionRoot=file:/home/osboxes/files/simple.json, numFiles=1, columns=[`*`], files=[file:/home/osboxes/files/simple.json]]]) {noformat} When Jdbc plugin is disabled: {noformat} 0: jdbc:drill:zk=local> select * from dfs.`/home/osboxes/files/simple.json`; +-+---+ | id | name | +-+---+ | 1 | Bob | +-+---+ 1 row selected (0.547 seconds) 0: jdbc:drill:zk=local> explain plan for select * from dfs.`/home/osboxes/files/simple.json`; +--+--+ | text | json | +--+--+ | 00-00Screen 00-01 Project(*=[$0]) 00-02Scan(groupscan=[EasyGroupScan [selectionRoot=file:/home/osboxes/files/simple.json, numFiles=1, columns=[`*`], files=[file:/home/osboxes/files/simple.json]]]) {noformat} The problem is that implicit columns are removed from queries with select * clause during project stage. But JdbcStoragePlugin adds ProjectRemoveRules.class to rules which simplifies query plan and removes project stage. https://github.com/apache/drill/blob/master/contrib/storage-jdbc/src/main/java/org/apache/drill/exec/store/jdbc/JdbcStoragePlugin.java#L140 was: When any Jdbc Plugin enabled (ex: MySql) implicit columns are returned as part of select * query. Simple json: {noformat} {id: 1, name: "Bob"} {noformat} When Jdbc plugin is enabled: {noformat} 0: jdbc:drill:zk=local> select * from dfs.`/home/osboxes/files/simple.json`; +--+--+--+-+-+---+ | fqn| filepath | filename | suffix | id | name | +--+--+--+-+-+---+ | /home/osboxes/files/simple.json | /home/osboxes/files | simple.json | json | 1 | Bob | +--+--+--+-+-+---+ 1 row selected (0.203 seconds) 0: jdbc:drill:zk=local> explain plan for select * from dfs.`/home/osboxes/files/simple.json`; +--+--+ | text | json | +--+--+ | 00-00Screen 00-01 Scan(groupscan=[EasyGroupScan [selectionRoot=file:/home/osboxes/files/simple.json, numFiles=1, columns=[`*`], files=[file:/home/osboxes/files/simple.json]]]) | { {noformat} When Jdbc plugin is disabled: {noformat} 0: jdbc:drill:zk=local> select * from dfs.`/home/osboxes/files/simple.json`; +-+---+ | id | name | +-+---+ | 1 | Bob | +-+---+ 1 row selected (0.547 seconds) 0: jdbc:drill:zk=local> explain plan for select * from dfs.`/home/osboxes/files/simple.json`; +--+--+ | text | json | +--+--+ | 00-00Screen 00-01 Project(*=[$0]) 00-02Scan(groupscan=[EasyGroupScan [selectionRoot=file:/home/osboxes/files/simple.json, numFiles=1, columns=[`*`], files=[file:/home/osboxes/files/simple.json]]]) {noformat} The problem is that implicit columns are removed from queries with select * clause during project stage. But JdbcStoragePlugin adds ProjectRemoveRules.class to rules which simplifies query plan and removes project stage. https://github.com/apache/drill/blob/master/contrib/storage-jdbc/src/main/java/org/apache/drill/exec/store/jdbc/JdbcStoragePlugin.java#L140 > Implicit columns are shown when Jdbc plugin is enabled > -- > > Key: DRILL-4903 > URL: https://issues.apache.org/jira/browse/DRILL-4903 > Project: Apache Drill > Issue Type: Bug >Affects Versions: 1.8.0 >Reporter: Arina Ielchiieva >Priority: Minor > Fix For: Future > > > When any Jdbc Plugin enabled (ex: MySql) implicit columns are returned as > part of select * query. > Simple json: >
[jira] [Created] (DRILL-4903) Implicit columns are shown when Jdbc plugin is enabled
Arina Ielchiieva created DRILL-4903: --- Summary: Implicit columns are shown when Jdbc plugin is enabled Key: DRILL-4903 URL: https://issues.apache.org/jira/browse/DRILL-4903 Project: Apache Drill Issue Type: Bug Affects Versions: 1.8.0 Reporter: Arina Ielchiieva Priority: Minor Fix For: Future When any Jdbc Plugin enabled (ex: MySql) implicit columns are returned as part of select * query. Simple json: {noformat} {id: 1, name: "Bob"} {noformat} When Jdbc plugin is enabled: {noformat} 0: jdbc:drill:zk=local> select * from dfs.`/home/osboxes/files/simple.json`; +--+--+--+-+-+---+ | fqn| filepath | filename | suffix | id | name | +--+--+--+-+-+---+ | /home/osboxes/files/simple.json | /home/osboxes/files | simple.json | json | 1 | Bob | +--+--+--+-+-+---+ 1 row selected (0.203 seconds) 0: jdbc:drill:zk=local> explain plan for select * from dfs.`/home/osboxes/files/simple.json`; +--+--+ | text | json | +--+--+ | 00-00Screen 00-01 Scan(groupscan=[EasyGroupScan [selectionRoot=file:/home/osboxes/files/simple.json, numFiles=1, columns=[`*`], files=[file:/home/osboxes/files/simple.json]]]) | { {noformat} When Jdbc plugin is disabled: {noformat} 0: jdbc:drill:zk=local> select * from dfs.`/home/osboxes/files/simple.json`; +-+---+ | id | name | +-+---+ | 1 | Bob | +-+---+ 1 row selected (0.547 seconds) 0: jdbc:drill:zk=local> explain plan for select * from dfs.`/home/osboxes/files/simple.json`; +--+--+ | text | json | +--+--+ | 00-00Screen 00-01 Project(*=[$0]) 00-02Scan(groupscan=[EasyGroupScan [selectionRoot=file:/home/osboxes/files/simple.json, numFiles=1, columns=[`*`], files=[file:/home/osboxes/files/simple.json]]]) {noformat} The problem is that implicit columns are removed from queries with select * clause during project stage. But JdbcStoragePlugin adds ProjectRemoveRules.class to rules which simplifies query plan and removes project stage. https://github.com/apache/drill/blob/master/contrib/storage-jdbc/src/main/java/org/apache/drill/exec/store/jdbc/JdbcStoragePlugin.java#L140 -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Assigned] (DRILL-4902) nested aggregate query does not complain about missing GROUP BY clause
[ https://issues.apache.org/jira/browse/DRILL-4902?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Gautam Kumar Parai reassigned DRILL-4902: - Assignee: Gautam Kumar Parai > nested aggregate query does not complain about missing GROUP BY clause > -- > > Key: DRILL-4902 > URL: https://issues.apache.org/jira/browse/DRILL-4902 > Project: Apache Drill > Issue Type: Bug > Components: Execution - Flow >Affects Versions: 1.9.0 >Reporter: Khurram Faraaz >Assignee: Gautam Kumar Parai > Labels: window_function > > A nested aggregate windowed query does not report an error when the > partitioning column is not used in the GROUP BY clause. > Drill 1.9.0 > This is the correct expected behavior. > {noformat} > 0: jdbc:drill:schema=dfs.tmp> select count(max(c7)) over (partition by c8) > from `DRILL_4589`; > Error: VALIDATION ERROR: From line 1, column 42 to line 1, column 43: > Expression 'c8' is not being grouped > SQL Query null > [Error Id: 09c837b9-7a66-4a1f-9fbc-522160947274 on centos-01.qa.lab:31010] > (state=,code=0) > {noformat} > The below query too should report above error, as the GROUP BY on > partitioning column is missing. > {noformat} > 0: jdbc:drill:schema=dfs.tmp> select count(max(c7)) over (partition by c8) > from (select * from `DRILL_4589`); > +-+ > | EXPR$0 | > +-+ > | 1 | > +-+ > 1 row selected (193.71 seconds) > {noformat} > Postgres 9.3 also reports an error for a similar query > {noformat} > postgres=# select count(max(c1)) over (partition by c2) from (select * from > t222) sub_query; > ERROR: column "sub_query.c2" must appear in the GROUP BY clause or be used > in an aggregate function > LINE 1: select count(max(c1)) over (partition by c2) from (select * ... > {noformat} -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Created] (DRILL-4902) nested aggregate query does not complain about missing GROUP BY clause
Khurram Faraaz created DRILL-4902: - Summary: nested aggregate query does not complain about missing GROUP BY clause Key: DRILL-4902 URL: https://issues.apache.org/jira/browse/DRILL-4902 Project: Apache Drill Issue Type: Bug Components: Execution - Flow Affects Versions: 1.9.0 Reporter: Khurram Faraaz A nested aggregate windowed query does not report an error when the partitioning column is not used in the GROUP BY clause. Drill 1.9.0 This is the correct expected behavior. {noformat} 0: jdbc:drill:schema=dfs.tmp> select count(max(c7)) over (partition by c8) from `DRILL_4589`; Error: VALIDATION ERROR: From line 1, column 42 to line 1, column 43: Expression 'c8' is not being grouped SQL Query null [Error Id: 09c837b9-7a66-4a1f-9fbc-522160947274 on centos-01.qa.lab:31010] (state=,code=0) {noformat} The below query too should report above error, as the GROUP BY on partitioning column is missing. {noformat} 0: jdbc:drill:schema=dfs.tmp> select count(max(c7)) over (partition by c8) from (select * from `DRILL_4589`); +-+ | EXPR$0 | +-+ | 1 | +-+ 1 row selected (193.71 seconds) {noformat} Postgres 9.3 also reports an error for a similar query {noformat} postgres=# select count(max(c1)) over (partition by c2) from (select * from t222) sub_query; ERROR: column "sub_query.c2" must appear in the GROUP BY clause or be used in an aggregate function LINE 1: select count(max(c1)) over (partition by c2) from (select * ... {noformat} -- This message was sent by Atlassian JIRA (v6.3.4#6332)