You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@drill.apache.org by "Arina Ielchiieva (JIRA)" <ji...@apache.org> on 2016/05/03 16:55:12 UTC

[jira] [Commented] (DRILL-4456) Hive translate function is not working

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

Arina Ielchiieva commented on DRILL-4456:
-----------------------------------------

Link to Calcite Jira  - https://issues.apache.org/jira/browse/CALCITE-1115

> Hive translate function is not working
> --------------------------------------
>
>                 Key: DRILL-4456
>                 URL: https://issues.apache.org/jira/browse/DRILL-4456
>             Project: Apache Drill
>          Issue Type: Improvement
>          Components: Functions - Hive
>    Affects Versions: 1.5.0
>            Reporter: Arina Ielchiieva
>             Fix For: Future
>
>
> In Hive "select translate(name, 'A', 'B') from users" works fine.
> But in Drill "select translate(name, 'A', 'B') from hive.`users`" returns the following error:
> org.apache.drill.common.exceptions.UserRemoteException: PARSE ERROR: Encountered "," at line 1, column 22. Was expecting one of: "USING" ... "NOT" ... "IN" ... "BETWEEN" ... "LIKE" ... "SIMILAR" ... "=" ... ">" ... "<" ... "<=" ... ">=" ... "<>" ... "+" ... "-" ... "*" ... "/" ... "||" ... "AND" ... "OR" ... "IS" ... "MEMBER" ... "SUBMULTISET" ... "MULTISET" ... "[" ... "." ... "(" ... while parsing SQL query: select translate(name, 'A', 'B') from hive.users ^ [Error Id: ba21956b-3285-4544-b3b2-fab68b95be1f on localhost:31010]
> Root cause:
> Calcite follows the standard SQL reference.
> SQL reference,  ISO/IEC 9075-2:2011(E), section 6.30
> <character transliteration> ::=
>   TRANSLATE <left paren> <character value expression>
> USING <transliteration name> <right paren>
> To fix:
> 1. add support to translate (expession, from_string, to_string) alternative syntax
> 2. add unit test in org.apache.drill.exec.fn.hive.TestInbuiltHiveUDFs
> Changes can be made directly in Calcite and then upgrade to appropriate Calcite version. 



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)