-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-29120][SQL][TESTS] Port create_view.sql #26290
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Since I've not filed some issues in jira, I set |
| CREATE VIEW v6_temp AS SELECT * FROM base_table WHERE id IN (SELECT id FROM temp_table); | ||
| CREATE VIEW v7_temp AS SELECT t1.id, t2.a FROM base_table t1, (SELECT * FROM temp_table) t2; | ||
| -- [SPARK-XXXXX] Not allowed to create a permanent view by referencing a temporary view in EXISTS | ||
| CREATE VIEW v8_temp AS SELECT * FROM base_table WHERE EXISTS (SELECT 1 FROM temp_table); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This test should fail and throw an exception with a message Not allowed to create a permanent view v8_temp by referencing a temporary view temp_table, but it passes now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| CREATE VIEW v7_temp AS SELECT t1.id, t2.a FROM base_table t1, (SELECT * FROM temp_table) t2; | ||
| -- [SPARK-XXXXX] Not allowed to create a permanent view by referencing a temporary view in EXISTS | ||
| CREATE VIEW v8_temp AS SELECT * FROM base_table WHERE EXISTS (SELECT 1 FROM temp_table); | ||
| CREATE VIEW v9_temp AS SELECT * FROM base_table WHERE NOT EXISTS (SELECT 1 FROM temp_table); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto
|
Test build #112825 has finished for PR 26290 at commit
|
|
Test build #112829 has finished for PR 26290 at commit
|
|
Jenkins, retest this please |
|
Test build #112835 has finished for PR 26290 at commit
|
|
Test build #112848 has finished for PR 26290 at commit
|
|
Thanks for taking care of completeness, @maropu . |
|
@dongjoon-hyun @HyukjinKwon @wangyum Anyone can check this? |
|
I'm also checking now, @maropu ~ |
sql/core/src/test/resources/sql-tests/inputs/postgreSQL/create_view.sql
Outdated
Show resolved
Hide resolved
sql/core/src/test/resources/sql-tests/inputs/postgreSQL/create_view.sql
Outdated
Show resolved
Hide resolved
sql/core/src/test/resources/sql-tests/inputs/postgreSQL/create_view.sql
Outdated
Show resolved
Hide resolved
| SELECT * FROM viewtest; | ||
|
|
||
| -- should fail | ||
| -- Spark can accept the DDL query below |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interesting! Do you now why PostgreSQL disallow this DDL query?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yea, I didn't know this behaviour, too, and it looks interesting to me. Just in case, I'll file jira for the behaivour. If I know something about this, I'll leave comments there.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FYI: I asked a PgSQL committer (who I know) why; it seems there is no strong reason not to support these view definitions and they, the PgSQL community, could do in theory. But, no one tries to make PRs for that, so they don't support now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Haha. Got it. Thanks!
sql/core/src/test/resources/sql-tests/inputs/postgreSQL/create_view.sql
Outdated
Show resolved
Hide resolved
sql/core/src/test/resources/sql-tests/inputs/postgreSQL/create_view.sql
Outdated
Show resolved
Hide resolved
sql/core/src/test/resources/sql-tests/inputs/postgreSQL/create_view.sql
Outdated
Show resolved
Hide resolved
sql/core/src/test/resources/sql-tests/inputs/postgreSQL/create_view.sql
Outdated
Show resolved
Hide resolved
dongjoon-hyun
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1, LGTM (with minor comments). Thank you, @maropu .
dongjoon-hyun
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1, LGTM. Merged to master.
Thank you, @maropu and @HyukjinKwon .
This is a test only PR and I tested the generated result locally.
|
Test build #112926 has finished for PR 26290 at commit
|
|
Thanks, @dongjoon-hyun , for your quick review and merge! |
What changes were proposed in this pull request?
This PR ports create_view.sql from PostgreSQL regression tests https://github.com/postgres/postgres/blob/REL_12_STABLE/src/test/regress/sql/create_view.sql
The expected results can be found in the link: https://github.com/postgres/postgres/blob/REL_12_STABLE/src/test/regress/expected/create_view.out
Why are the changes needed?
To check behaviour differences between Spark and PostgreSQL
Does this PR introduce any user-facing change?
No
How was this patch tested?
Pass the Jenkins. And, Comparison with PgSQL results