Skip to content

Conversation

@cloud-fan
Copy link
Contributor

before this PR, when users try to get an encoder for an un-supported class, they will only get a very simple error message like Encoder for type xxx is not supported.

After this PR, the error message become more friendly, for example:

No Encoder found for abc.xyz.NonEncodable
- array element class: "abc.xyz.NonEncodable"
- field (class: "scala.Array", name: "arrayField")
- root class: "abc.xyz.AnotherClass"

@cloud-fan
Copy link
Contributor Author

cc @marmbrus

@SparkQA
Copy link

SparkQA commented Nov 18, 2015

Test build #46217 has finished for PR 9810 at commit 3d9fcc9.

  • This patch fails Spark unit tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@SparkQA
Copy link

SparkQA commented Nov 18, 2015

Test build #46220 has finished for PR 9810 at commit 8d8d857.

  • This patch fails Spark unit tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

Copy link
Contributor

Choose a reason for hiding this comment

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

scala doc please

@marmbrus
Copy link
Contributor

This message looks great!

@rxin
Copy link
Contributor

rxin commented Nov 18, 2015

This is really cool.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Any suggestions for the error message format? cc @marmbrus @rxin

Copy link
Contributor

Choose a reason for hiding this comment

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

I actually think this looks pretty good.

@SparkQA
Copy link

SparkQA commented Nov 19, 2015

Test build #46328 has finished for PR 9810 at commit da13931.

  • This patch fails Scala style tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@SparkQA
Copy link

SparkQA commented Nov 19, 2015

Test build #46329 has finished for PR 9810 at commit ddb092a.

  • This patch fails Spark unit tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@cloud-fan
Copy link
Contributor Author

retest this please.

@SparkQA
Copy link

SparkQA commented Nov 19, 2015

Test build #46335 has finished for PR 9810 at commit ddb092a.

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

Copy link
Contributor

Choose a reason for hiding this comment

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

Why is this a separate function now? Now we have duplicated copies of the same logic that can fall out of sync.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I tried but stuck with array handling. For array we use MapObjects and call extractorFor lazily as a function parameter. Any ideas for it?

Copy link
Contributor

Choose a reason for hiding this comment

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

An initial eager call with a dummy attribute reference?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

sounds good, let me have a try

@SparkQA
Copy link

SparkQA commented Nov 20, 2015

Test build #46385 has finished for PR 9810 at commit c263c14.

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

@marmbrus
Copy link
Contributor

Thanks, merging to master and 1.6.

asfgit pushed a commit that referenced this pull request Nov 20, 2015
before this PR, when users try to get an encoder for an un-supported class, they will only get a very simple error message like `Encoder for type xxx is not supported`.

After this PR, the error message become more friendly, for example:
```
No Encoder found for abc.xyz.NonEncodable
- array element class: "abc.xyz.NonEncodable"
- field (class: "scala.Array", name: "arrayField")
- root class: "abc.xyz.AnotherClass"
```

Author: Wenchen Fan <wenchen@databricks.com>

Closes #9810 from cloud-fan/error-message.

(cherry picked from commit 3b9d2a3)
Signed-off-by: Michael Armbrust <michael@databricks.com>
@asfgit asfgit closed this in 3b9d2a3 Nov 20, 2015
@JoshRosen
Copy link
Contributor

@cloud-fan
Copy link
Contributor Author

@JoshRosen , I think the reason maybe that, I defined some private methods in trait ScalaReflection and use them in object ScalaReflection extends ScalaReflection, seems scala 2.11 doesn't support this, let me change those methods to public and see if it works.

@cloud-fan cloud-fan deleted the error-message branch November 21, 2015 04:44
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.

5 participants