Skip to content
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

Closed
wants to merge 6 commits into from

Conversation

marmbrus
Copy link
Contributor

@marmbrus marmbrus commented Feb 6, 2015

Also start from the bottom so we show the first error instead of the top error.

@SparkQA
Copy link

SparkQA commented Feb 6, 2015

Test build #26946 has started for PR 4439 at commit 6235db4.

  • This patch merges cleanly.

@SparkQA
Copy link

SparkQA commented Feb 6, 2015

Test build #26946 has finished for PR 4439 at commit 6235db4.

  • This patch fails to build.
  • This patch merges cleanly.
  • This patch adds no public classes.

@AmplabJenkins
Copy link

Test FAILed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/26946/
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
Copy link
Contributor

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point.

@AmplabJenkins
Copy link

Test FAILed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/26962/
Test FAILed.

@scwf
Copy link
Contributor

scwf commented Feb 7, 2015

retest this please

@SparkQA
Copy link

SparkQA commented Feb 7, 2015

Test build #26978 has started for PR 4439 at commit fede90a.

  • This patch merges cleanly.

@SparkQA
Copy link

SparkQA commented Feb 7, 2015

Test build #26978 has finished for PR 4439 at commit fede90a.

  • This patch fails to build.
  • This patch merges cleanly.
  • This patch adds the following public classes (experimental):
    • class AnalysisException(message: String) extends Exception(message) with Serializable

@AmplabJenkins
Copy link

Test FAILed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/26978/
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(",")
Copy link
Contributor

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...

Copy link
Contributor Author

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.

@cloud-fan
Copy link
Contributor

Should we throw AnalysisException instead of sys.error at here?

@SparkQA
Copy link

SparkQA commented Feb 9, 2015

Test build #27060 has started for PR 4439 at commit f88079f.

  • This patch merges cleanly.

@SparkQA
Copy link

SparkQA commented Feb 9, 2015

Test build #27060 has finished for PR 4439 at commit f88079f.

  • This patch fails to build.
  • This patch merges cleanly.
  • This patch adds the following public classes (experimental):
    • class AnalysisException(message: String) extends Exception(message) with Serializable

@AmplabJenkins
Copy link

Test FAILed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/27060/
Test FAILed.

@cloud-fan
Copy link
Contributor

Sorry I forgot that... Once you throw AnalysisException at here, you also need to update the test case SPARK-5278 to expect AnalysisException.

Conflicts:
	sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/Analyzer.scala
@SparkQA
Copy link

SparkQA commented Feb 10, 2015

Test build #27237 has started for PR 4439 at commit a773bba.

  • This patch merges cleanly.

@SparkQA
Copy link

SparkQA commented Feb 10, 2015

Test build #27237 has finished for PR 4439 at commit a773bba.

  • This patch fails Spark unit tests.
  • This patch merges cleanly.
  • This patch adds the following public classes (experimental):
    • class AnalysisException(message: String) extends Exception(message) with Serializable
    • case class PrettyAttribute(name: String) extends Attribute with trees.LeafNode[Expression]
    • implicit class DebugSQLContext(sqlContext: SQLContext)

@AmplabJenkins
Copy link

Test FAILed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/27237/
Test FAILed.

@SparkQA
Copy link

SparkQA commented Feb 11, 2015

Test build #27247 has started for PR 4439 at commit 45862a0.

  • This patch merges cleanly.

@SparkQA
Copy link

SparkQA commented Feb 11, 2015

Test build #27247 has finished for PR 4439 at commit 45862a0.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds the following public classes (experimental):
    • class AnalysisException(message: String) extends Exception(message) with Serializable
    • case class PrettyAttribute(name: String) extends Attribute with trees.LeafNode[Expression]
    • implicit class DebugSQLContext(sqlContext: SQLContext)

@AmplabJenkins
Copy link

Test PASSed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/27247/
Test PASSed.

asfgit pushed a commit that referenced this pull request Feb 11, 2015
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]>
@asfgit asfgit closed this in 6195e24 Feb 11, 2015
@marmbrus marmbrus deleted the analysisException branch February 17, 2015 20:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants