[
https://issues.apache.org/jira/browse/DRILL-2041?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14285044#comment-14285044
]
Jinfeng Ni commented on DRILL-2041:
-----------------------------------
I modified the error message to the following for the 1st query. The rest of
those affected queries will hit similar error message.
{code}
Map, Array or repeated scalar type should not be used in group by, order by or
in a comparison operator. Drill does not support compare between
VARCHAR:REPEATED and VARCHAR:REPEATED.
{code}
I should point out that unlike schema-based system where query planner will
check if the group by key / order by keys are comparable and raise error if not
during planning time, a schema-less system like Drill will not know the type
until the execution time. At execution time, Drill physical operators will
know the operand type and do such check. However, since there is no direct
mapping between SQL component and physical operators, the error message will
not be as friendly as that in schema-based system. For instance, Drill
currently does not maintain the information that a physical Sort operator is
for Group By, or for Order By, or for merge join operation.
> Throw unsupported error message on GROUP BY/ORDER BY array/map types
> --------------------------------------------------------------------
>
> Key: DRILL-2041
> URL: https://issues.apache.org/jira/browse/DRILL-2041
> Project: Apache Drill
> Issue Type: Bug
> Components: Query Planning & Optimization
> Affects Versions: 0.8.0
> Reporter: Victoria Markman
> Assignee: Jinfeng Ni
>
> test.json
> {code}
> { "CustomerId": "100", "cityId": 10 , "phoneNumber": { "areaCode": "622",
> "number": "1567845"}, "years": ["1990", "1993", "1998", "2008"]}{code}
> {code}
> 0: jdbc:drill:schema=dfs> select years from `test.json` order by years;
> +------------+
> | years |
> +------------+
> Query failed: RemoteRpcException: Failure while running fragment., Failure
> finding function that runtime code generation expected. Signature:
> compare_to( VARCHAR:REPEATEDVARCHAR:REPEATED, ) returns INT:REQUIRED [
> 5e4a9574-1f9b-4753-ab1d-ef056639281f on atsqa4-133.qa.lab:31010 ]
> [ 5e4a9574-1f9b-4753-ab1d-ef056639281f on atsqa4-133.qa.lab:31010 ]
> java.lang.RuntimeException: java.sql.SQLException: Failure while executing
> query.
> at sqlline.SqlLine$IncrementalRows.hasNext(SqlLine.java:2514)
> at sqlline.SqlLine$TableOutputFormat.print(SqlLine.java:2148)
> at sqlline.SqlLine.print(SqlLine.java:1809)
> at sqlline.SqlLine$Commands.execute(SqlLine.java:3766)
> at sqlline.SqlLine$Commands.sql(SqlLine.java:3663)
> at sqlline.SqlLine.dispatch(SqlLine.java:889)
> at sqlline.SqlLine.begin(SqlLine.java:763)
> at sqlline.SqlLine.start(SqlLine.java:498)
> at sqlline.SqlLine.main(SqlLine.java:460)
> 0: jdbc:drill:schema=dfs> select years from `test.json` group by years;
> Query failed: RemoteRpcException: Failure while running fragment., Failure
> finding function that runtime code generation expected. Signature:
> compare_to( VARCHAR:REPEATEDVARCHAR:REPEATED, ) returns INT:REQUIRED [
> be1d64d5-bb03-4d5d-87b0-5cd8aa32f007 on atsqa4-133.qa.lab:31010 ]
> [ be1d64d5-bb03-4d5d-87b0-5cd8aa32f007 on atsqa4-133.qa.lab:31010 ]
> Error: exception while executing query: Failure while executing query.
> (state=,code=0)
> {code}
> {code}
> 0: jdbc:drill:schema=dfs> select * from `test.json` order by phoneNumber;
> +------------+------------+-------------+------------+
> | CustomerId | cityId | phoneNumber | years |
> +------------+------------+-------------+------------+
> Query failed: RemoteRpcException: Failure while running fragment., Failure
> finding function that runtime code generation expected. Signature:
> compare_to( MAP:REQUIREDMAP:REQUIRED, ) returns INT:REQUIRED [
> cbef0629-b393-4fbd-9c16-941ec8835d36 on atsqa4-133.qa.lab:31010 ]
> [ cbef0629-b393-4fbd-9c16-941ec8835d36 on atsqa4-133.qa.lab:31010 ]
> java.lang.RuntimeException: java.sql.SQLException: Failure while executing
> query.
> at sqlline.SqlLine$IncrementalRows.hasNext(SqlLine.java:2514)
> at sqlline.SqlLine$TableOutputFormat.print(SqlLine.java:2148)
> at sqlline.SqlLine.print(SqlLine.java:1809)
> at sqlline.SqlLine$Commands.execute(SqlLine.java:3766)
> at sqlline.SqlLine$Commands.sql(SqlLine.java:3663)
> at sqlline.SqlLine.dispatch(SqlLine.java:889)
> at sqlline.SqlLine.begin(SqlLine.java:763)
> at sqlline.SqlLine.start(SqlLine.java:498)
> at sqlline.SqlLine.main(SqlLine.java:460)
> 0: jdbc:drill:schema=dfs> select phoneNumber from `test.json` group by
> phoneNumber;
> Query failed: RemoteRpcException: Failure while running fragment., Failure
> finding function that runtime code generation expected. Signature:
> compare_to( MAP:REQUIREDMAP:REQUIRED, ) returns INT:REQUIRED [
> fbd3ca20-5d5a-4831-a066-a2d780547e66 on atsqa4-133.qa.lab:31010 ]
> [ fbd3ca20-5d5a-4831-a066-a2d780547e66 on atsqa4-133.qa.lab:31010 ]
> Error: exception while executing query: Failure while executing query.
> (state=,code=0)
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)