Skip to content

Conversation

@fusheng9399
Copy link

@fusheng9399 fusheng9399 commented Jan 4, 2026

What changes were proposed in this pull request?

When I execute the following code:

val query = "CREATE OR REPLACE TEMPORARY VIEW A using parquet options (path = 'xxx'); insert into table B select * from A /* comment */";

val cli = new SparkSQLCLIDriver

val commands = cli.splitSemiColon(query)

The query would be split to one statement:

CREATE OR REPLACE TEMPORARY VIEW A using parquet options (path = 'xxx')

So in splitSemiColon, we should consider this case.

After this PR, the query will be split it into two statements:
The first:

CREATE OR REPLACE TEMPORARY VIEW A using parquet options (path = 'xxx')

The second:

insert into table B select * from A /* comment */

Why are the changes needed?

In splitSemiColon, we should support the above scenario.

Does this PR introduce any user-facing change?

No

How was this patch tested?

Added UT.

Was this patch authored or co-authored using generative AI tooling?

No

@github-actions github-actions bot added the SQL label Jan 4, 2026
@github-actions
Copy link

github-actions bot commented Jan 4, 2026

JIRA Issue Information

=== Bug SPARK-54876 ===
Summary: The splitSemiColon function should correctly split SQL statements
Assignee: None
Status: Open
Affected: ["4.0.1"]


This comment was automatically generated by GitHub Actions

@fusheng9399 fusheng9399 changed the title [SPARK-54876][SQL][FOLLOWUP] Spark SQL CLI:Incorrectly split the SQL statements [SPARK-54876][SQL] Spark SQL CLI:Incorrectly split the SQL statements Jan 4, 2026
@fusheng9399 fusheng9399 changed the title [SPARK-54876][SQL] Spark SQL CLI:Incorrectly split the SQL statements [SPARK-54876][SQL] The splitSemiColon function should correctly split SQL statements Jan 5, 2026
@fusheng9399 fusheng9399 changed the title [SPARK-54876][SQL] The splitSemiColon function should correctly split SQL statements [SPARK-54876][SQL] The splitSemiColon function should correctly split sql statements Jan 5, 2026
@fusheng9399 fusheng9399 changed the title [SPARK-54876][SQL] The splitSemiColon function should correctly split sql statements [SPARK-54876][SQL] The splitSemiColon function should correctly split SQL statements Jan 5, 2026
@fusheng9399 fusheng9399 closed this Jan 5, 2026
@fusheng9399 fusheng9399 force-pushed the spark-multi-statements branch from e83d504 to 2f12bc6 Compare January 5, 2026 04:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant