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

[Spark-20873][SQL] Improve the error message for unsupported Column Type #18097

Closed
wants to merge 3 commits into from

Conversation

setjet
Copy link
Contributor

@setjet setjet commented May 24, 2017

What changes were proposed in this pull request?

Upon encountering an invalid columntype, the column type object is printed, rather than the type.
This change improves this by outputting its name.

How was this patch tested?

Added a simple unit test to verify the contents of the raised exception

@gatorsmile
Copy link
Member

ok to test

@SparkQA
Copy link

SparkQA commented May 25, 2017

Test build #77340 has started for PR 18097 at commit f53de3e.

test("show type name in type mismatch error") {
val invalidType = new DataType {
override def defaultSize: Int = 1
override private[spark] def asNullable: DataType = null
Copy link
Member

Choose a reason for hiding this comment

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

null -> this

@@ -684,7 +684,7 @@ private[columnar] object ColumnType {
case struct: StructType => STRUCT(struct)
case udt: UserDefinedType[_] => apply(udt.sqlType)
case other =>
throw new Exception(s"Unsupported type: $other")
throw new Exception(s"Unsupported type: ${other.typeName}")
Copy link
Member

Choose a reason for hiding this comment

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

typeName -> simpleString

@SparkQA
Copy link

SparkQA commented May 25, 2017

Test build #77377 has finished for PR 18097 at commit 90433a9.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@gatorsmile
Copy link
Member

Thanks! Merging to master.

@asfgit asfgit closed this in c491e2e May 26, 2017
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.

3 participants