[
https://issues.apache.org/jira/browse/PHOENIX-836?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13931215#comment-13931215
]
Hudson commented on PHOENIX-836:
--------------------------------
SUCCESS: Integrated in Apache Phoenix - Branch:3.0 #3 (See
[https://builds.apache.org/job/Phoenix-3.0/3/])
PHOENIX-836 Cast syntax is not in line with standard SQL (GabrielReid)
(jamestaylor: rev 7c942bbaca23783e93e21e24fe148839c0db902f)
* phoenix-core/src/test/java/org/apache/phoenix/compile/QueryCompilerTest.java
* phoenix-core/src/test/java/org/apache/phoenix/end2end/QueryTest.java
* phoenix-core/src/main/antlr3/PhoenixSQL.g
> Cast syntax is not in line with standard SQL
> --------------------------------------------
>
> Key: PHOENIX-836
> URL: https://issues.apache.org/jira/browse/PHOENIX-836
> Project: Phoenix
> Issue Type: Bug
> Reporter: Gabriel Reid
> Attachments: PHOENIX-836.2.patch, PHOENIX-836.patch
>
>
> It seems the cast syntax in Phoenix is not in line with SQL-92/99 (1), as
> well as other common SQL databases (2 & 3).
> A typical cast statement in SQL is written as
> {code}
> SELECT CAST(ID AS INTEGER) FROM MYTAB;
> {code}
> but this leads to a parse error in Phoenix. Instead, Phoenix expects cast
> statements to be written as follows (I believe the parentheses are optional
> here)
> {code}
> SELECT (CAST ID AS INTEGER) FROM MYTAB;
> {code}
> (1) http://savage.net.au/SQL/sql-99.bnf.html#cast%20specification
> (2) http://docs.oracle.com/javadb/10.8.2.2/ref/rrefsqlj33562.html
> (3) http://dev.mysql.com/doc/refman/5.0/en/cast-functions.html#function_cast
--
This message was sent by Atlassian JIRA
(v6.2#6252)