-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-16288][SQL] Implement inline table generating function #13976
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 #61479 has finished for PR 13976 at commit
|
|
The failure seems to be irrelevant to this PR. |
|
Retest this please. |
|
Test build #61494 has finished for PR 13976 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.
give an example in extended?
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.
Sure.
|
Test build #61542 has finished for PR 13976 at commit
|
|
looks pretty good. I will let @cloud-fan review and do the merge. |
|
Yep. Thank you, @rxin . |
|
Test build #61562 has finished for PR 13976 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.
how about
StructType(et.fields.zipWithIndex.map {
case (field, index) => StructField(s"col{$index + 1}", field.dataType, nullable = field.nullable)
})
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.
actually that's the best !
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.
Sure. Thanks, @cloud-fan !
|
Thank you, @cloud-fan . :) I've learn a lot in this PR again.
|
|
Test build #61615 has finished for PR 13976 at commit
|
|
|
||
| override def elementSchema: StructType = child.dataType match { | ||
| case ArrayType(et : StructType, _) => | ||
| StructType(et.fields.zipWithIndex.map { |
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.
hmm, so it's just et now?
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.
Yep. Currently, our type checker ensures that homogeneous StructType array.
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.
why not return et directly?
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.
Oh, my god. I was too naive, here.
Thank you!
|
Thank you, @cloud-fan . |
|
Test build #61622 has started for PR 13976 at commit |
|
jenkins, test this please |
|
Thank you, @shaneknapp ! :) |
|
no problem... sorry i had to kill it, but i wanted to get a quick jenkins restart in. :) |
|
Test build #61624 has finished for PR 13976 at commit
|
| Row(3) :: Nil) | ||
| } | ||
|
|
||
| test("inline raises exception on empty array") { |
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.
on array of null type?
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.
Yep. That's more clear.
|
Thank you, @cloud-fan . |
|
Test build #61647 has finished for PR 13976 at commit
|
|
Oh, I found a bug and am working on this. |
|
Actually, that is not a bug, but I found that there exists a little difference between Spark and Hive with the following query. In short, Spark does more strict type-checking, e.g., I only add more tests to clarify the cases. We cannot touch that because it depends on many things. The following query is a workaround which both Spark/Hive work. |
|
Test build #61669 has finished for PR 13976 at commit
|
|
Test build #61670 has finished for PR 13976 at commit
|
|
Test build #61676 has finished for PR 13976 at commit
|
| Nil | ||
| } else { | ||
| for (i <- 0 until inputArray.numElements()) | ||
| yield inputArray.getStruct(i, numFields) |
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'm not sure how is the performance of for-yield, maybe it's safe to create an array manually and use while loop here?
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.
Thank you, @cloud-fan . By the way, for about this, @rxin gave me an advice at the first commit of this PR.
we don't need to materialize the array, do we? We can create an iterator to return the results.
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.
ah i see, for-yield returns an iterator.
|
merging to master, thanks! |
|
Thank you, @cloud-fan and @rxin ! :) |
This PR implements `inline` table generating function. Pass the Jenkins tests with new testcase. Author: Dongjoon Hyun <[email protected]> Closes #13976 from dongjoon-hyun/SPARK-16288. (cherry picked from commit 88134e7) Signed-off-by: Reynold Xin <[email protected]>
### What changes were proposed in this pull request? The pr aims to upgrade `netty` from `4.1.109.Final` to `4.1.110.Final`. ### Why are the changes needed? - https://netty.io/news/2024/05/22/4-1-110-Final.html This version has brought some bug fixes and improvements, such as: Fix Zstd throws Exception on read-only volumes (netty/netty#13982) Add unix domain socket transport in netty 4.x via JDK16+ ([#13965](netty/netty#13965)) Backport #13075: Add the AdaptivePoolingAllocator ([#13976](netty/netty#13976)) Add no-value key handling only for form body ([#13998](netty/netty#13998)) Add support for specifying SecureRandom in SSLContext initialization ([#14058](netty/netty#14058)) - https://github.com/netty/netty/issues?q=milestone%3A4.1.110.Final+is%3Aclosed ### Does this PR introduce _any_ user-facing change? No. ### How was this patch tested? Pass GA. ### Was this patch authored or co-authored using generative AI tooling? No. Closes #46744 from panbingkun/SPARK-48420. Authored-by: panbingkun <[email protected]> Signed-off-by: yangjie01 <[email protected]>
What changes were proposed in this pull request?
This PR implements
inlinetable generating function.How was this patch tested?
Pass the Jenkins tests with new testcase.