[GitHub] drill issue #685: Drill 5043: Function that returns a unique id per session/...
Github user nagarajanchinnasamy commented on the issue: https://github.com/apache/drill/pull/685 @arina-ielchiieva @sudheeshkatkam I have made the following changes to support invocation of UDFs without parenthesis. 1. Introduced `isNiladic` option in FunctionTemplate and added a property in DrillFuncHolder, FunctionAttributes, DrillSqlOperator classes 2. Overridden DrillSqlOperator.getSyntax() to return SqlSyntax.FUNCTION_ID when isNiladic is true 3. Modified all the places to pass false for isNiladic parameter to DrillSqlOperator constructor -- so that existing behavior is not impacted 4. In DrillOperatorTable, adding an operator to operatorList when the syntax of an operator is either FUNCTION or FUNCTION_ID 5. Modified tests to invoke session_id without parenthesis. Please review the changes. --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---
[jira] [Created] (DRILL-5197) CASE statement fails due to error: Unable to get value vector class for minor type [NULL] and mode [OPTIONAL]
Muhammad Gelbana created DRILL-5197: --- Summary: CASE statement fails due to error: Unable to get value vector class for minor type [NULL] and mode [OPTIONAL] Key: DRILL-5197 URL: https://issues.apache.org/jira/browse/DRILL-5197 Project: Apache Drill Issue Type: Bug Components: Execution - Data Types Affects Versions: 1.9.0 Reporter: Muhammad Gelbana The following query fails for no obvious reason {code:sql} SELECT CASE WHEN `tname`.`full_name` = 'ABC' THEN ( CASE WHEN `tname`.`full_name` = 'ABC' THEN ( CASE WHEN `tname`.`full_name` = ' ' THEN ( CASE WHEN `tname`.`full_name` = 'ABC' THEN `tname`.`full_name` ELSE NULL END ) ELSE NULL END ) ELSE NULL END ) WHEN `tname`.`full_name` = 'ABC' THEN NULL ELSE NULL END FROM cp.`employee.json` `tname` {code} If the `THEN `tname`.`full_name`` statements is changed to `THEN 'ABC'` the error does not occur. Thrown exception {quote} [Error Id: e75fd0fe-132b-4eb4-b2e8-7b34dc39657e on mgelbana-incorta:31010] at org.apache.drill.common.exceptions.UserException$Builder.build(UserException.java:543) ~[drill-common-1.9.0.jar:1.9.0] at org.apache.drill.exec.work.fragment.FragmentExecutor.sendFinalState(FragmentExecutor.java:293) [drill-java-exec-1.9.0.jar:1.9.0] at org.apache.drill.exec.work.fragment.FragmentExecutor.cleanup(FragmentExecutor.java:160) [drill-java-exec-1.9.0.jar:1.9.0] at org.apache.drill.exec.work.fragment.FragmentExecutor.run(FragmentExecutor.java:262) [drill-java-exec-1.9.0.jar:1.9.0] at org.apache.drill.common.SelfCleaningRunnable.run(SelfCleaningRunnable.java:38) [drill-common-1.9.0.jar:1.9.0] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [na:1.8.0_111] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [na:1.8.0_111] at java.lang.Thread.run(Thread.java:745) [na:1.8.0_111] Caused by: java.lang.UnsupportedOperationException: Unable to get value vector class for minor type [NULL] and mode [OPTIONAL] at org.apache.drill.exec.expr.BasicTypeHelper.getValueVectorClass(BasicTypeHelper.java:441) ~[vector-1.9.0.jar:1.9.0] at org.apache.drill.exec.record.VectorContainer.addOrGet(VectorContainer.java:123) ~[drill-java-exec-1.9.0.jar:1.9.0] at org.apache.drill.exec.physical.impl.project.ProjectRecordBatch.setupNewSchema(ProjectRecordBatch.java:463) ~[drill-java-exec-1.9.0.jar:1.9.0] at org.apache.drill.exec.record.AbstractSingleRecordBatch.innerNext(AbstractSingleRecordBatch.java:78) ~[drill-java-exec-1.9.0.jar:1.9.0] at org.apache.drill.exec.physical.impl.project.ProjectRecordBatch.innerNext(ProjectRecordBatch.java:135) ~[drill-java-exec-1.9.0.jar:1.9.0] at org.apache.drill.exec.record.AbstractRecordBatch.next(AbstractRecordBatch.java:162) ~[drill-java-exec-1.9.0.jar:1.9.0] at org.apache.drill.exec.physical.impl.BaseRootExec.next(BaseRootExec.java:104) ~[drill-java-exec-1.9.0.jar:1.9.0] at org.apache.drill.exec.physical.impl.ScreenCreator$ScreenRoot.innerNext(ScreenCreator.java:81) ~[drill-java-exec-1.9.0.jar:1.9.0] at org.apache.drill.exec.physical.impl.BaseRootExec.next(BaseRootExec.java:94) ~[drill-java-exec-1.9.0.jar:1.9.0] at org.apache.drill.exec.work.fragment.FragmentExecutor$1.run(FragmentExecutor.java:232) ~[drill-java-exec-1.9.0.jar:1.9.0] at org.apache.drill.exec.work.fragment.FragmentExecutor$1.run(FragmentExecutor.java:226) ~[drill-java-exec-1.9.0.jar:1.9.0] at java.security.AccessController.doPrivileged(Native Method) ~[na:1.8.0_111] at javax.security.auth.Subject.doAs(Subject.java:422) ~[na:1.8.0_111] at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1657) ~[hadoop-common-2.7.1.jar:na] at org.apache.drill.exec.work.fragment.FragmentExecutor.run(FragmentExecutor.java:226) [drill-java-exec-1.9.0.jar:1.9.0] ... 4 common frames omitted {quote} -- This message was sent by Atlassian JIRA (v6.3.4#6332)