-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-2059][SQL] Add analysis checks #1263
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
|
Merged build triggered. |
|
Merged build started. |
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.
nitpick sort the import
|
Merged build finished. |
|
Refer to this link for build results: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/16245/ |
|
Maybe also add a test case? |
[SPARK-2059][SQL] Add analysis checks
This replaces #1263 with a test case. Author: Reynold Xin <[email protected]> Author: Michael Armbrust <[email protected]> Closes #1265 from rxin/sql-analysis-error and squashes the following commits: a639e01 [Reynold Xin] Added a test case for unresolved attribute analysis. 7371e1b [Reynold Xin] Merge pull request #1263 from marmbrus/analysisChecks 448c088 [Michael Armbrust] Add analysis checks
This replaces #1263 with a test case. Author: Reynold Xin <[email protected]> Author: Michael Armbrust <[email protected]> Closes #1265 from rxin/sql-analysis-error and squashes the following commits: a639e01 [Reynold Xin] Added a test case for unresolved attribute analysis. 7371e1b [Reynold Xin] Merge pull request #1263 from marmbrus/analysisChecks 448c088 [Michael Armbrust] Add analysis checks (cherry picked from commit b3e768e) Signed-off-by: Reynold Xin <[email protected]>
This replaces #1263 with a test case. Author: Reynold Xin <[email protected]> Author: Michael Armbrust <[email protected]> Closes #1265 from rxin/sql-analysis-error and squashes the following commits: a639e01 [Reynold Xin] Added a test case for unresolved attribute analysis. 7371e1b [Reynold Xin] Merge pull request #1263 from marmbrus/analysisChecks 448c088 [Michael Armbrust] Add analysis checks (cherry picked from commit b3e768e) Signed-off-by: Reynold Xin <[email protected]>
This replaces apache#1263 with a test case. Author: Reynold Xin <[email protected]> Author: Michael Armbrust <[email protected]> Closes apache#1265 from rxin/sql-analysis-error and squashes the following commits: a639e01 [Reynold Xin] Added a test case for unresolved attribute analysis. 7371e1b [Reynold Xin] Merge pull request apache#1263 from marmbrus/analysisChecks 448c088 [Michael Armbrust] Add analysis checks
…#1263) ### What changes were proposed in this pull request? This PR enhance `UnwrapCastInBinaryComparison` to support unwrap timestamp type. The way to unwrap timestamp type are: ``` GreaterThan(Cast(ts, DateType), date) -> GreaterThanOrEqual(ts, Cast(date + 1, TimestampType)) GreaterThanOrEqual(Cast(ts, DateType), date) -> GreaterThanOrEqual(ts, Cast(date, TimestampType)) LessThan(Cast(ts, DateType), date) -> LessThan(ts, Cast(date, TimestampType)) LessThanOrEqual(Cast(ts, DateType), date) -> LessThan(ts, Cast(date + 1, TimestampType)) EqualTo(Cast(ts, DateType), date) -> And(GreaterThanOrEqual(ts, Cast(date, TimestampType)), LessThan(ts, Cast(date + 1, TimestampType))) ``` ### Why are the changes needed? Improve query performance. A common use case. We store cold data in HDFS by partition, store hot data in MySQL, and then union all the results. The filter in the MySQL branch cannot be pushed down, which affects performance: ```sql CREATE TABLE t_cold(id bigint, start timestamp, dt date) using parquet PARTITIONED BY (dt); CREATE TABLE t_hot(id bigint, start timestamp) using org.apache.spark.sql.jdbc OPTIONS (`url` '***', `dbtable` 'db.t2', `user` 'spark', `password` '***'); CREATE VIEW all_data AS SELECT * FROM t_cold UNION ALL SELECT *, to_date(start) FROM t_hot; SELECT * FROM all_data WHERE start BETWEEN '2023-02-06' AND '2023-02-07'; ``` Before this PR | After this PR -- | -- <img src="https://user-images.githubusercontent.com/5399861/221576723-7fc45356-65db-48e2-8d40-88420c21c9f5.png" width="400" height="730"> | <img src="https://user-images.githubusercontent.com/5399861/221575848-5b975ed0-70ab-4527-acfe-796cc20e169b.png" width="400" height="730"> ### Does this PR introduce _any_ user-facing change? No. ### How was this patch tested? Unit test.
…code and UI for MultiauthWebUiFilter (apache#1263)
An initial version of analysis checks. Long term we are going to want something more complete, but this at least prevents us from making it all the way execution with obvious problems. For example, doing a sort on a misspelled attribute is actually enough to kill the DAG scheduler.