You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "Remus Rusanu (JIRA)" <ji...@apache.org> on 2017/02/06 21:35:41 UTC

[jira] [Created] (CALCITE-1620) CAST('' AS BINARY) is supported by Hive, but not by Calcite

Remus Rusanu created CALCITE-1620:
-------------------------------------

             Summary: CAST('<string>' AS BINARY) is supported by Hive, but not by Calcite
                 Key: CALCITE-1620
                 URL: https://issues.apache.org/jira/browse/CALCITE-1620
             Project: Calcite
          Issue Type: Bug
            Reporter: Remus Rusanu
            Assignee: Julian Hyde


Hive supports CAST('1' as BINARY). Result is 0x31 (can be tested with {noformat}SELECT HEX(CAST('1' as BINARY));{noformat}. If I'm not mistaken, the CAST result is the UTF-8 encoding of the input string.
CALCITE 1.11 throws AssertionException during compilation for such an expression:

Thread [db11b6e6-8fa7-48b3-82ef-c5b4550327ec main] (Suspended (exception AssertionError))             
                ConstantExpression.<init>(Type, Object) line: 50      
                Expressions.constant(Object, Type) line: 586             
                OptimizeShuttle.visit(UnaryExpression, Expression) line: 279
                UnaryExpression.accept(Shuttle) line: 37   
                Expressions.acceptExpressions(List<Expression>, Shuttle) line: 3184  
                MethodCallExpression.accept(Shuttle) line: 60         
                TernaryExpression.accept(Shuttle) line: 45



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)