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

Arina Ielchiieva commented on DRILL-7501:
-----------------------------------------

Paul, this change was done deliberately. sqltypeof function returns sql name of 
the type, the one which is used in schema file, since Drill map in reality is a 
struct, it returns struct naming. drillsqltypeof function will return map 
naming since this is how structs are named in Drill.

> Drill 1.17 sqlTypeOf for a Map now reports STRUCT
> -------------------------------------------------
>
>                 Key: DRILL-7501
>                 URL: https://issues.apache.org/jira/browse/DRILL-7501
>             Project: Apache Drill
>          Issue Type: Bug
>    Affects Versions: 1.16.0
>            Reporter: Paul Rogers
>            Priority: Minor
>
> Drill 1.14 introduced the {{sqlTypeOf()}} function to workaround limits of 
> the {{typeof()}} function. {{sqlTypeOf()}} should return the name of the SQL 
> type for a column, using the type name that Drill uses.
> A query from page 163 of _Learning Apache Drill_:
> {code:sql}
> SELECT sqlTypeOf(`name`) AS name_type FROM `json/nested.json`;
> {code}
> Drill 1.14 results (correct):
> {noformat}
> +------------+
> | name_type  |
> +------------+
> | MAP        |
> +------------+
> {noformat}
> Drill 1.17 results (incorrect):
> {noformat}
> +-----------+
> | name_type |
> +-----------+
> | STRUCT    |
> +-----------+
> {noformat}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to