-
Notifications
You must be signed in to change notification settings - Fork 28.5k
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
[SQL] Add an exception for analysis errors. #4439
Conversation
Test build #26946 has started for PR 4439 at commit
|
Test build #26946 has finished for PR 4439 at commit
|
Test FAILed. |
@@ -33,6 +33,11 @@ import org.apache.spark.sql.types.IntegerType | |||
object SimpleAnalyzer extends Analyzer(EmptyCatalog, EmptyFunctionRegistry, true) | |||
|
|||
/** | |||
* Thrown when a query fails to analyze, usually because the query itself is invalid. | |||
*/ | |||
class AnalysisException(message: String) extends Exception(message) with Serializable |
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.
can we move this to org.apache.sql so we can document it in javadoc/scaladoc?
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.
Good point.
Test FAILed. |
retest this please |
Test build #26978 has started for PR 4439 at commit
|
Test build #26978 has finished for PR 4439 at commit
|
Test FAILed. |
case p if p.expressions.exists(!_.resolved) => | ||
throw new TreeNodeException(p, | ||
s"Unresolved attributes: ${p.expressions.filterNot(_.resolved).mkString(",")}") | ||
val missing = p.expressions.filterNot(_.resolved).map(_.prettyString).mkString(",") |
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.
prettyString is added in #4436, which have not in...
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.
Yeah, thanks. I had a giant branch that I broke up into 5 different PRs. Will retest once that is merged.
Should we throw |
Test build #27060 has started for PR 4439 at commit
|
Test build #27060 has finished for PR 4439 at commit
|
Test FAILed. |
Sorry I forgot that... Once you throw |
Conflicts: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/Analyzer.scala
Test build #27237 has started for PR 4439 at commit
|
Test build #27237 has finished for PR 4439 at commit
|
Test FAILed. |
Test build #27247 has started for PR 4439 at commit
|
Test build #27247 has finished for PR 4439 at commit
|
Test PASSed. |
Also start from the bottom so we show the first error instead of the top error. Author: Michael Armbrust <[email protected]> Closes #4439 from marmbrus/analysisException and squashes the following commits: 45862a0 [Michael Armbrust] fix hive test a773bba [Michael Armbrust] Merge remote-tracking branch 'origin/master' into analysisException f88079f [Michael Armbrust] update more cases fede90a [Michael Armbrust] newline fbf4bc3 [Michael Armbrust] move to sql 6235db4 [Michael Armbrust] [SQL] Add an exception for analysis errors. (cherry picked from commit 6195e24) Signed-off-by: Michael Armbrust <[email protected]>
Also start from the bottom so we show the first error instead of the top error.