You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hive.apache.org by "Naresh P R (Jira)" <ji...@apache.org> on 2021/03/11 22:27:00 UTC

[jira] [Updated] (HIVE-24877) Support X'xxxx' syntax for hexadecimal values like spark & mysql

     [ https://issues.apache.org/jira/browse/HIVE-24877?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Naresh P R updated HIVE-24877:
------------------------------
    Description: 
Hive is currently not supporting following syntax

select x'abc';
{code:java}
org.apache.hadoop.hive.ql.parse.ParseException: line 2:8 cannot recognize input near 'x' ''abc'' '<EOF>' in selection targetorg.apache.hadoop.hive.ql.parse.ParseException: line 2:8 cannot recognize input near 'x' ''abc'' '<EOF>' in selection target at org.apache.hadoop.hive.ql.parse.ParseDriver.parse(ParseDriver.java:125) at org.apache.hadoop.hive.ql.parse.ParseUtils.parse(ParseUtils.java:93) at org.apache.hadoop.hive.ql.parse.ParseUtils.parse(ParseUtils.java:85) at org.apache.hadoop.hive.ql.Compiler.parse(Compiler.java:169) at org.apache.hadoop.hive.ql.Compiler.compile(Compiler.java:102) at org.apache.hadoop.hive.ql.Driver.compile(Driver.java:492) at org.apache.hadoop.hive.ql.Driver.compileInternal(Driver.java:445){code}
Though we have same via hex/unhex built-in UDF's, it's better to have {{X'value'}} and x'{{value'}} syntax support for Hive.

[https://spark.apache.org/docs/latest/sql-ref-literals.html#binary-literal]

[https://dev.mysql.com/doc/refman/8.0/en/string-functions.html#function_hex]

[https://mariadb.com/kb/en/hexadecimal-literals/]

  was:
Hive is currently not supporting following syntax

select x'abc';
{code:java}
org.apache.hadoop.hive.ql.parse.ParseException: line 2:8 cannot recognize input near 'x' ''abc'' '<EOF>' in selection target org.apache.hadoop.hive.ql.parse.ParseException: line 2:8 cannot recognize input near 'x' ''31FECCCCCC'' '<EOF>' in selection target at org.apache.hadoop.hive.ql.parse.ParseDriver.parse(ParseDriver.java:125) at org.apache.hadoop.hive.ql.parse.ParseUtils.parse(ParseUtils.java:93) at org.apache.hadoop.hive.ql.parse.ParseUtils.parse(ParseUtils.java:85) at org.apache.hadoop.hive.ql.Compiler.parse(Compiler.java:169) at org.apache.hadoop.hive.ql.Compiler.compile(Compiler.java:102) at org.apache.hadoop.hive.ql.Driver.compile(Driver.java:492) at org.apache.hadoop.hive.ql.Driver.compileInternal(Driver.java:445){code}
Though we have same via hex/unhex built-in UDF's, it's better to have {{X'value'}} and x'{{value'}} syntax support for Hive.

[https://spark.apache.org/docs/latest/sql-ref-literals.html#binary-literal]

[https://dev.mysql.com/doc/refman/8.0/en/string-functions.html#function_hex]

https://mariadb.com/kb/en/hexadecimal-literals/


> Support X'xxxx' syntax for hexadecimal values like spark & mysql
> ----------------------------------------------------------------
>
>                 Key: HIVE-24877
>                 URL: https://issues.apache.org/jira/browse/HIVE-24877
>             Project: Hive
>          Issue Type: New Feature
>            Reporter: Naresh P R
>            Priority: Minor
>
> Hive is currently not supporting following syntax
> select x'abc';
> {code:java}
> org.apache.hadoop.hive.ql.parse.ParseException: line 2:8 cannot recognize input near 'x' ''abc'' '<EOF>' in selection targetorg.apache.hadoop.hive.ql.parse.ParseException: line 2:8 cannot recognize input near 'x' ''abc'' '<EOF>' in selection target at org.apache.hadoop.hive.ql.parse.ParseDriver.parse(ParseDriver.java:125) at org.apache.hadoop.hive.ql.parse.ParseUtils.parse(ParseUtils.java:93) at org.apache.hadoop.hive.ql.parse.ParseUtils.parse(ParseUtils.java:85) at org.apache.hadoop.hive.ql.Compiler.parse(Compiler.java:169) at org.apache.hadoop.hive.ql.Compiler.compile(Compiler.java:102) at org.apache.hadoop.hive.ql.Driver.compile(Driver.java:492) at org.apache.hadoop.hive.ql.Driver.compileInternal(Driver.java:445){code}
> Though we have same via hex/unhex built-in UDF's, it's better to have {{X'value'}} and x'{{value'}} syntax support for Hive.
> [https://spark.apache.org/docs/latest/sql-ref-literals.html#binary-literal]
> [https://dev.mysql.com/doc/refman/8.0/en/string-functions.html#function_hex]
> [https://mariadb.com/kb/en/hexadecimal-literals/]



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