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

Andrew McGrath updated HIVE-29835:
----------------------------------
    Description: 
h3. *{{Summary}}*


{{SORT BY}} without {{LIMIT}} incorrectly triggers the "order by without limit" 
strict check (regression from 4.0.1).
h3. Steps to reproduce
{code:java}
SET hive.strict.checks.orderby.no.limit=true;
CREATE TABLE t1 (a INT, b INT);
INSERT INTO t1 VALUES (1, 10), (2, 20), (3, 30);{code}
This query fails:
{code:java}
SELECT * FROM t1 DISTRIBUTE BY a SORT BY a; {code}
with the following error:
{code:java}
Error: Error while compiling statement: FAILED: SemanticException Order by-s 
without limit are disabled for safety reasons. If you know what you are doing, 
please set hive.strict.checks.orderby.no.limit to false and make sure that 
hive.mapred.mode is not set to 'strict' to proceed. Note that you may get 
errors or incorrect results if you make a mistake while using some of the 
unsafe features.. Cannot tell the position of null AST. {code}
While this query does not cause an error (which should be equivalent):
{code:java}
SELECT * FROM t1 CLUSTER BY a; {code}
h3. Workaround
{code:java}
SET hive.cbo.enable=false; {code}

  was:
{{SORT BY}} without {{LIMIT}} incorrectly triggers the "order by without limit" 
strict check (regression from 4.0.1).


Steps to reproduce:
{code:java}
SET hive.strict.checks.orderby.no.limit=true;
CREATE TABLE t1 (a INT, b INT);
INSERT INTO t1 VALUES (1, 10), (2, 20), (3, 30);{code}
This query fails:
{code:java}
SELECT * FROM t1 DISTRIBUTE BY a SORT BY a; {code}
with the following error:
{code:java}
Error: Error while compiling statement: FAILED: SemanticException Order by-s 
without limit are disabled for safety reasons. If you know what you are doing, 
please set hive.strict.checks.orderby.no.limit to false and make sure that 
hive.mapred.mode is not set to 'strict' to proceed. Note that you may get 
errors or incorrect results if you make a mistake while using some of the 
unsafe features.. Cannot tell the position of null AST. {code}

While this query does not cause an error (which should be equivalent):
{code:java}
SELECT * FROM t1 CLUSTER BY a; {code}


> SORT BY ... without LIMIT incorrectly triggers 
> hive.strict.checks.orderby.no.limit
> ----------------------------------------------------------------------------------
>
>                 Key: HIVE-29835
>                 URL: https://issues.apache.org/jira/browse/HIVE-29835
>             Project: Hive
>          Issue Type: Bug
>          Components: Hive
>    Affects Versions: 4.2.0
>         Environment: Upgrading from Hive 4.0.1 to 4.2.0
>            Reporter: Andrew McGrath
>            Priority: Major
>
> h3. *{{Summary}}*
> {{SORT BY}} without {{LIMIT}} incorrectly triggers the "order by without 
> limit" strict check (regression from 4.0.1).
> h3. Steps to reproduce
> {code:java}
> SET hive.strict.checks.orderby.no.limit=true;
> CREATE TABLE t1 (a INT, b INT);
> INSERT INTO t1 VALUES (1, 10), (2, 20), (3, 30);{code}
> This query fails:
> {code:java}
> SELECT * FROM t1 DISTRIBUTE BY a SORT BY a; {code}
> with the following error:
> {code:java}
> Error: Error while compiling statement: FAILED: SemanticException Order by-s 
> without limit are disabled for safety reasons. If you know what you are 
> doing, please set hive.strict.checks.orderby.no.limit to false and make sure 
> that hive.mapred.mode is not set to 'strict' to proceed. Note that you may 
> get errors or incorrect results if you make a mistake while using some of the 
> unsafe features.. Cannot tell the position of null AST. {code}
> While this query does not cause an error (which should be equivalent):
> {code:java}
> SELECT * FROM t1 CLUSTER BY a; {code}
> h3. Workaround
> {code:java}
> SET hive.cbo.enable=false; {code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to