-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-24268][SQL] Use datatype.simpleString in error messages #21321
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
Changes from 2 commits
ada7667
e09026b
bd8446c
781b64d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -208,7 +208,8 @@ class FeatureHasher(@Since("2.3.0") override val uid: String) extends Transforme | |
| require(dataType.isInstanceOf[NumericType] || | ||
| dataType.isInstanceOf[StringType] || | ||
| dataType.isInstanceOf[BooleanType], | ||
| s"FeatureHasher requires columns to be of NumericType, BooleanType or StringType. " + | ||
| s"FeatureHasher requires columns to be of ${NumericType.simpleString}, " + | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In the original PR it doesn't seem like we rewrote the constant types only the dynamic ones (and this PR also doesn't seem to consistently rewrite the constant types referenced). What's the reason/how do you decide which ones you want to rewrite to ref simpleString?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this PR rewrites always constant type referenced. I am not sure why you are saying it is not. If I missed some places, then it was just because I haven't seen them.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think that's my bad, looking through it I saw some raw type names but those are all in the suites which makes sense. |
||
| s"${BooleanType.simpleString} or ${StringType.simpleString}. " + | ||
| s"Column $fieldName was $dataType") | ||
| } | ||
| val attrGroup = new AttributeGroup($(outputCol), $(numFeatures)) | ||
|
|
||
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.
Another option would be to use SchemaUtils
checkColumnTypeshere -- what do you think?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.
I couldn't do that because
NumericTypeis anAbstractDataTypeand not aDataTypeso I couldn't use that method.