You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@drill.apache.org by "Vitalii Diravka (JIRA)" <ji...@apache.org> on 2018/12/10 17:22:00 UTC

[jira] [Commented] (DRILL-6891) Drill cannot cast required type to optional and vise versa that may cause failures of functions with more than one argument.

    [ https://issues.apache.org/jira/browse/DRILL-6891?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16715158#comment-16715158 ] 

Vitalii Diravka commented on DRILL-6891:
----------------------------------------

covar_samp UDF has only implementations with INT-OPTIONAL parameters. And this UDF should be picked for all other combination of DataModes of parameters with changing the schema. Similar to the query with both NOT NULL parameters:{code}
0: jdbc:drill:zk=local> select covar_samp(l_partkey, l_linenumber)
. . . . . . .semicolon>    from cp.`tpch/lineitem.parquet` limit 5;
+---------------------+
|       EXPR$0        |
+---------------------+
| 1.6204799492218658  |
+---------------------+
1 row selected (0.289 seconds)
0: jdbc:drill:zk=local> select modeof(l_partkey), modeof(l_linenumber)
. . . . . . .semicolon>    from cp.`tpch/lineitem.parquet` limit 1;
+-----------+-----------+
|  EXPR$0   |  EXPR$1   |
+-----------+-----------+
| NOT NULL  | NOT NULL  |
+-----------+-----------+
1 row selected (0.306 seconds)
{code}


> Drill cannot cast required type to optional and vise versa that may cause failures of functions with more than one argument.
> ----------------------------------------------------------------------------------------------------------------------------
>
>                 Key: DRILL-6891
>                 URL: https://issues.apache.org/jira/browse/DRILL-6891
>             Project: Apache Drill
>          Issue Type: Bug
>          Components: Functions - Drill
>    Affects Versions: 1.14.0
>            Reporter: Anton Gozhiy
>            Priority: Major
>             Fix For: Future
>
>
> *Query:*
> {code:sql}
> with t (pkey, lnum) as 
>   (select l_partkey,
>           case when l_linenumber < 3 then null else l_linenumber end 
>    from cp.`tpch/lineitem.parquet`)
> select covar_samp(pkey, lnum) from t limit 5
> {code}
> *Note:* Case statement is needed to transform required data mod to optional.
> *Expected result:*
>  The function should return result.
> *Actual result:*
>  Exception happens: Missing function implementation: [covar_samp(INT-REQUIRED, INT-OPTIONAL)]
> {noformat}
> SYSTEM ERROR: Drill Remote Exception
> Please, refer to logs for more information.
>   (org.apache.drill.exec.exception.SchemaChangeException) Failure while materializing expression. 
> Error in expression at index -1.  Error: Missing function implementation: [covar_samp(INT-REQUIRED, INT-OPTIONAL)].  Full expression: --UNKNOWN EXPRESSION--.
>     org.apache.drill.exec.physical.impl.aggregate.StreamingAggBatch.createAggregatorInternal():513
>     org.apache.drill.exec.physical.impl.aggregate.StreamingAggBatch.createAggregator():434
>     org.apache.drill.exec.physical.impl.aggregate.StreamingAggBatch.buildSchema():181
>     org.apache.drill.exec.record.AbstractRecordBatch.next():161
>     org.apache.drill.exec.record.AbstractRecordBatch.next():126
>     org.apache.drill.exec.record.AbstractRecordBatch.next():116
>     org.apache.drill.exec.record.AbstractUnaryRecordBatch.innerNext():63
>     org.apache.drill.exec.physical.impl.limit.LimitRecordBatch.innerNext():101
>     org.apache.drill.exec.record.AbstractRecordBatch.next():186
>     org.apache.drill.exec.record.AbstractRecordBatch.next():126
>     org.apache.drill.exec.record.AbstractRecordBatch.next():116
>     org.apache.drill.exec.record.AbstractUnaryRecordBatch.innerNext():63
>     org.apache.drill.exec.record.AbstractRecordBatch.next():186
>     org.apache.drill.exec.record.AbstractRecordBatch.next():126
>     org.apache.drill.exec.record.AbstractRecordBatch.next():116
>     org.apache.drill.exec.record.AbstractUnaryRecordBatch.innerNext():63
>     org.apache.drill.exec.physical.impl.project.ProjectRecordBatch.innerNext():143
>     org.apache.drill.exec.record.AbstractRecordBatch.next():186
>     org.apache.drill.exec.physical.impl.BaseRootExec.next():104
>     org.apache.drill.exec.physical.impl.ScreenCreator$ScreenRoot.innerNext():83
>     org.apache.drill.exec.physical.impl.BaseRootExec.next():94
>     org.apache.drill.exec.work.fragment.FragmentExecutor$1.run():297
>     org.apache.drill.exec.work.fragment.FragmentExecutor$1.run():284
>     .......():0
>     org.apache.hadoop.security.UserGroupInformation.doAs():1669
>     org.apache.drill.exec.work.fragment.FragmentExecutor.run():284
>     org.apache.drill.common.SelfCleaningRunnable.run():38
>     .......():0
> {noformat}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)