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

Fix the simpleString used in error messages #18667

Closed
wants to merge 1 commit into from

Conversation

fxbonnet
Copy link

@fxbonnet fxbonnet commented Jul 18, 2017

What changes were proposed in this pull request?

Fix the simpleString used in error messages

How was this patch tested?

(Please explain how this patch was tested. E.g. unit tests, integration tests, manual tests)
(If this patch involves UI changes, please attach a screenshot; otherwise, remove this)

Please review http://spark.apache.org/contributing.html before opening a pull request.

@AmplabJenkins
Copy link

Can one of the admins verify this patch?

@@ -43,7 +43,7 @@ class LongType private() extends IntegralType {
*/
override def defaultSize: Int = 8

override def simpleString: String = "bigint"
override def simpleString: String = "long"
Copy link
Member

Choose a reason for hiding this comment

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

I don't think so. bigint is the SQL type for an 8-byte integer, right?

Copy link
Author

Choose a reason for hiding this comment

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

When you try to read a csv and map to a case class with a Long your get a message like this one:
EXCEPTION:org.apache.spark.sql.AnalysisException: Cannot up cast linked_docs.MR_NUMBER_OF_DOCS_UPLOADED from string to bigint as it may truncate
The type path of the target object is:

  • field (class: "scala.Long", name: "MR_NUMBER_OF_DOCS_UPLOADED")

Getting a message that talks about bigint while you are trying to cast a String to a Long looks confusing to me. I thought this was a typo.

Copy link
Member

Choose a reason for hiding this comment

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

You're renaming the whole type, when the issue is at best that some intermediate stage of the plan does cast to bigint first. At the least, this is not the fix, and I'm not sure it's really a problem, even if the error is from an implementation detail.

@srowen srowen mentioned this pull request Jul 31, 2017
@asfgit asfgit closed this in 3a45c7f Aug 5, 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