-
Notifications
You must be signed in to change notification settings - Fork 28.9k
[SPARK-12438][SQL] Add SQLUserDefinedType support for encoder #10390
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
Conversation
|
Test build #48050 has finished for PR 10390 at commit
|
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.
can we also test encoder.fromRow?
we can just create a MyLabelPoint and encode it to InternalRow and decode it back by encoder, and check if the decoded MyLabelPoint is same with the original one.
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 added the test now. By doing this, I also found that we need to add UserDefinedType to Cast to make it work.
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 think this worth another JIRA.
Is ScalaRelfection the only place that may use UDT in Cast?
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 think so, as it is a special use case. I will open another JIRA for it.
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.
This fixing is submitted as pr #10410.
|
Test build #48100 has finished for PR 10390 at commit
|
|
I think we need more design work before we implement this. I'm not a huge fan of the current UDT API and I think we will replace it in Spark 2.0. |
|
That is fine. But we will leave it broken until Spark2.0? |
|
We can revisit this if we do a 1.7 release, but I don't think that is going to happen. |
|
Personally, I would like to see this to be merged because it blocks my another PR #10283. Can we merge this and go back to modify this part when we revamp UDT API in the future? But of course it depends on you. Thanks. |
|
Okay, I'm fine with merging this now to unblock other progress. However, I think we should move the test to be with the other encoder tests. |
|
@marmbrus Thanks. However, to move the test means that we need to move the UDT classes to encoder tests. I think it might duplicate the codes. Is it ok for you? |
|
Test build #48468 has finished for PR 10390 at commit
|
|
Do you mean just the example UDT |
|
@marmbrus Not only MyLabeledPoint, which is just a case class. Also including UDT MyDenseVectorUDT and MyDenseVector. I think it might duplicate too many lines of codes from UserDefinedTypeSuite to encoder test suite like ExpressionEncoderSuite. |
|
We alread have UDT in |
|
@cloud-fan I just think the same thing. I will try it. |
|
Test build #48547 has finished for PR 10390 at commit
|
|
Test build #48548 has finished for PR 10390 at commit
|
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.
These changes are not needed.
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.
Forgot to remove them.
|
Test build #48721 has finished for PR 10390 at commit
|
|
Thanks, merging to master. |
JIRA: https://issues.apache.org/jira/browse/SPARK-12438 ScalaReflection lacks the support of SQLUserDefinedType. We should add it. Author: Liang-Chi Hsieh <[email protected]> Closes apache#10390 from viirya/encoder-udt.
JIRA: https://issues.apache.org/jira/browse/SPARK-12438
ScalaReflection lacks the support of SQLUserDefinedType. We should add it.