-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-24695] [SQL]: To add support to return Calendar interval from udf. #21679
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
## What changes were proposed in this pull request? This change adds capability to return Calender interval from udf. Earlier, the udf of Type (String => CalendarInterval) was throwing Exception stating: Schema for type org.apache.spark.unsafe.types.CalendarInterval is not supported java.lang.UnsupportedOperationException: Schema for type org.apache.spark.unsafe.types.CalendarInterval is not supported at org.apache.spark.sql.catalyst.ScalaReflection391anonfun.apply(ScalaReflection.scala:781) ## How was this patch tested? Added test case in ScalaReflectionSuite.scala and ExpressionEncoderSuite.scala Also, tested by creating an udf that returns Calendar interval. jira entry for detail: https://issues.apache.org/jira/browse/SPARK-24695
|
Since |
|
btw, can you update the title like |
gatorsmile
left a comment
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.
In the short term, we do not plan to make CalendarInterval public.
|
org.apache.spark.unsafe.types.CalenderInterval is already public, am i missing something. |
|
Actually, the unsafe package does not include user-facing classes. |
|
Yea, so it's kind of half public now but not completely exposed. It should be exposed before we extend its support. |
|
What if i make changes to expose it? |
|
I would better open a discussion thread in the mailing list before making a PR to expose it. Shell we leave this close this meanwhile? I think it's better to leave active and actionable PRs only. |
|
I think we should close this for now then. |
|
For your information, @cloud-fan and I are discussing how we expose calendar interval data types. Will post the proposal later. |
|
I think this one is reasonable. We already exposed it as an argument to a UDF, so it is pretty poor UX to not allow a return type. As for making CalendarInterval public, what is there to do besides moving it? Reopening this one. |
|
@priyankagargnitk can you update this one. |
|
Can one of the admins verify this patch? |
|
@priyankagargnitk ping, are you still there? |
|
I am working on this, I'll update the PR in a day or two. |
|
A new PR has been raised. |
Closes apache#21766 Closes apache#21679 Closes apache#21161 Closes apache#20846 Closes apache#19434 Closes apache#18080 Closes apache#17648 Closes apache#17169 Add: Closes apache#22813 Closes apache#21994 Closes apache#22005 Closes apache#22463 Add: Closes apache#15899 Add: Closes apache#22539 Closes apache#21868 Closes apache#21514 Closes apache#21402 Closes apache#21322 Closes apache#21257 Closes apache#20163 Closes apache#19691 Closes apache#18697 Closes apache#18636 Closes apache#17176 Closes apache#23001 from wangyum/CloseStalePRs. Authored-by: Yuming Wang <[email protected]> Signed-off-by: hyukjinkwon <[email protected]>
What changes were proposed in this pull request?
This change adds capability to return Calender interval from udf.
Earlier, the udf of Type (String => CalendarInterval) was throwing Exception stating:
Schema for type org.apache.spark.unsafe.types.CalendarInterval is not supported
java.lang.UnsupportedOperationException: Schema for type org.apache.spark.unsafe.types.CalendarInterval is not supported
at org.apache.spark.sql.catalyst.ScalaReflection391anonfun.apply(ScalaReflection.scala:781)
How was this patch tested?
Added test case in ScalaReflectionSuite.scala and ExpressionEncoderSuite.scala
Also, tested by creating an udf that returns Calendar interval.
jira entry for detail: https://issues.apache.org/jira/browse/SPARK-24695