You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Dusan Tisma (Jira)" <ji...@apache.org> on 2025/02/26 12:38:00 UTC

[jira] [Created] (SPARK-51324) FOR empty results throws error if nested and only statement in body.

Dusan Tisma created SPARK-51324:
-----------------------------------

             Summary: FOR empty results throws error if nested and only statement in body.
                 Key: SPARK-51324
                 URL: https://issues.apache.org/jira/browse/SPARK-51324
             Project: Spark
          Issue Type: Sub-task
          Components: Spark Core
    Affects Versions: 4.0.0, 4.1
            Reporter: Dusan Tisma


FOR statement will currently fail if it is nested in a compound statement, is the only statement in that body AND returns an empty result. For example:


{{BEGIN}}
{{ CREATE TABLE t (intCol INT) using parquet;}}
{{ REPEAT}}
{{   FOR SELECT * FROM t ORDER BY intCol DO}}
{{     SELECT intCol;}}
{{   END FOR;}}
{{ UNTIL 1 = 1}}
{{ END REPEAT;}}
{{END

}}
throws 
{{[INTERNAL_ERROR] No more elements to iterate through in the current SQL compound statement. SQLSTATE: XX000}}



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

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org