-
Notifications
You must be signed in to change notification settings - Fork 28.2k
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
Conversation
ok to test |
Test build #77340 has started for PR 18097 at commit |
test("show type name in type mismatch error") { | ||
val invalidType = new DataType { | ||
override def defaultSize: Int = 1 | ||
override private[spark] def asNullable: DataType = null |
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.
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}") |
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.
typeName
-> simpleString
Test build #77377 has finished for PR 18097 at commit
|
Thanks! Merging to master. |
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