[jira] [Comment Edited] (PHOENIX-3347) Change conformance or remove SELECT statements without FROM clauses

2016-10-04 Thread Maryann Xue (JIRA)

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

Maryann Xue edited comment on PHOENIX-3347 at 10/5/16 6:03 AM:
---

We just added support for != into ORACLE_10 and that's why we switched from 
default to ORACLE_10. [~julianhyde], can or should we make != in some other 
conformance level as well?


was (Author: maryannxue):
We just added support for "!=" into ORACLE_10 and that's why we switched from 
default to ORACLE_10. [~julianhyde], can or should we make "!=" in some other 
conformance level as well?

> Change conformance or remove SELECT statements without FROM clauses
> ---
>
> Key: PHOENIX-3347
> URL: https://issues.apache.org/jira/browse/PHOENIX-3347
> Project: Phoenix
>  Issue Type: Sub-task
>Reporter: Eric Lomore
>Assignee: Eric Lomore
>
> Current conformance settings do not allow SELECT statements without a FROM 
> clause. Either need to change conformance or stop supporting SELECT without 
> FROM as Phoenix currently does.
> According to the Calcite parser,
> {{FROM is mandatory in standard SQL, optional in dialects such as MySQL, 
> PostgreSQL. The parser allows SELECT without FROM, but the validator fails if 
> conformance is, say, STRICT_2003.}}
> Based on PhoenixCalciteEmbeddedDriver.java, we are using ORACLE_10 
> conformance which does not support this
> {code}setPropertyIfNotSpecified(
> info2,
> CalciteConnectionProperty.CONFORMANCE.camelName(),
> SqlConformance.ORACLE_10.toString()){code}
> Confirming this is the fact that it is specifically the SqlValidator throwing 
> the exception in relevant test cases
> {{Caused by: org.apache.calcite.sql.validate.SqlValidatorException: SELECT 
> must have a FROM clause}}



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


[jira] [Comment Edited] (PHOENIX-3347) Change conformance or remove SELECT statements without FROM clauses

2016-10-04 Thread Eric Lomore (JIRA)

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

Eric Lomore edited comment on PHOENIX-3347 at 10/5/16 12:12 AM:


{code}public boolean isFromRequired()
Whether FROM clause is required in a SELECT statement.
True in ORACLE_10, STRICT_92, STRICT_99, STRICT_2003; false otherwise.{code}

Switching to any of these 3 should work as there are no other changes except 
this (the fix passes 3 additional test cases as it should)
DEFAULT
PRAGMATIC_99
PRAGMATIC_2003

http://calcite.apache.org/apidocs/org/apache/calcite/sql/validate/SqlConformance.html

[~maryannxue], with your blessing, can I proceed with a quick patch to change 
conformance to DEFAULT or one of the others if that's preferred? Thanks!


was (Author: lomoree):
{code}public boolean isFromRequired()
Whether FROM clause is required in a SELECT statement.
True in ORACLE_10, STRICT_92, STRICT_99, STRICT_2003; false otherwise.{code}

Switching to any of these 3 should work as there are no other changes except 
this.
DEFAULT
PRAGMATIC_99
PRAGMATIC_2003

http://calcite.apache.org/apidocs/org/apache/calcite/sql/validate/SqlConformance.html

[~maryannxue], with your blessing, can I proceed with a quick patch to change 
conformance to DEFAULT or one of the others if that's preferred? Thanks!

> Change conformance or remove SELECT statements without FROM clauses
> ---
>
> Key: PHOENIX-3347
> URL: https://issues.apache.org/jira/browse/PHOENIX-3347
> Project: Phoenix
>  Issue Type: Sub-task
>Reporter: Eric Lomore
>Assignee: Eric Lomore
>
> Current conformance settings do not allow SELECT statements without a FROM 
> clause. Either need to change conformance or stop supporting SELECT without 
> FROM as Phoenix currently does.
> According to the Calcite parser,
> {{FROM is mandatory in standard SQL, optional in dialects such as MySQL, 
> PostgreSQL. The parser allows SELECT without FROM, but the validator fails if 
> conformance is, say, STRICT_2003.}}
> Based on PhoenixCalciteEmbeddedDriver.java, we are using ORACLE_10 
> conformance which does not support this
> {code}setPropertyIfNotSpecified(
> info2,
> CalciteConnectionProperty.CONFORMANCE.camelName(),
> SqlConformance.ORACLE_10.toString()){code}
> Confirming this is the fact that it is specifically the SqlValidator throwing 
> the exception in relevant test cases
> {{Caused by: org.apache.calcite.sql.validate.SqlValidatorException: SELECT 
> must have a FROM clause}}



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


[jira] [Comment Edited] (PHOENIX-3347) Change conformance or remove SELECT statements without FROM clauses

2016-10-04 Thread Eric Lomore (JIRA)

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

Eric Lomore edited comment on PHOENIX-3347 at 10/4/16 11:59 PM:


{code}public boolean isFromRequired()
Whether FROM clause is required in a SELECT statement.
True in ORACLE_10, STRICT_92, STRICT_99, STRICT_2003; false otherwise.{code}

Switching to any of these 3 should work as there are no other changes except 
this.
DEFAULT
PRAGMATIC_99
PRAGMATIC_2003

http://calcite.apache.org/apidocs/org/apache/calcite/sql/validate/SqlConformance.html

[~maryannxue], with your blessing, can I proceed with a quick patch to change 
conformance to DEFAULT or one of the others if that's preferred? Thanks!


was (Author: lomoree):
{code}public boolean isFromRequired()
Whether FROM clause is required in a SELECT statement.
True in ORACLE_10, STRICT_92, STRICT_99, STRICT_2003; false otherwise.{code}

Switching to any of these 3 should work as there are no other changes except 
this.
DEFAULT
PRAGMATIC_99
PRAGMATIC_2003

http://calcite.apache.org/apidocs/org/apache/calcite/sql/validate/SqlConformance.html

[~maryannxue] with your blessing, can I proceed with a quick patch to change to 
DEFAULT or one of the others if that's preferred? Thanks!

> Change conformance or remove SELECT statements without FROM clauses
> ---
>
> Key: PHOENIX-3347
> URL: https://issues.apache.org/jira/browse/PHOENIX-3347
> Project: Phoenix
>  Issue Type: Sub-task
>Reporter: Eric Lomore
>Assignee: Eric Lomore
>
> Current conformance settings do not allow SELECT statements without a FROM 
> clause. Either need to change conformance or stop supporting SELECT without 
> FROM as Phoenix currently does.
> According to the Calcite parser,
> {{FROM is mandatory in standard SQL, optional in dialects such as MySQL, 
> PostgreSQL. The parser allows SELECT without FROM, but the validator fails if 
> conformance is, say, STRICT_2003.}}
> Based on PhoenixCalciteEmbeddedDriver.java, we are using ORACLE_10 
> conformance which does not support this
> {code}setPropertyIfNotSpecified(
> info2,
> CalciteConnectionProperty.CONFORMANCE.camelName(),
> SqlConformance.ORACLE_10.toString()){code}
> Confirming this is the fact that it is specifically the SqlValidator throwing 
> the exception in relevant test cases
> {{Caused by: org.apache.calcite.sql.validate.SqlValidatorException: SELECT 
> must have a FROM clause}}



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