-
Notifications
You must be signed in to change notification settings - Fork 28.7k
[SPARK-8826] [SQL] Fix ClassCastException in GeneratedAggregate #7225
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 #36543 has finished for PR 7225 at commit
|
inputSchema: Seq[Attribute], | ||
mutableRow: Boolean = false) = { | ||
this(expressions.map(BindReferences.bindReference(_, inputSchema)), mutableRow) | ||
} |
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 this change? If you want to use mutable row in projection, you can use InterpretedMutableProjection
.
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.
Yes, but InterpretedProjection and InterpretedMutableProjection has different semantic on returning object. It would be same thing if call setTarget() before each apply() call but I wanted keep it simple without incurring another problem.
Test build #36545 has finished for PR 7225 at commit
|
|
||
test("SPARK-8826 Fix ClassCastException in GeneratedAggregate") { | ||
|
||
// when codegen = false, CCE is thrown if group-by expression is empty or unsafe is disabled |
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.
Doesn't the use of GeneratedAggregate
imply that codegen must be enabled?
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.
Basically, I'm wondering if this is a bug. If this problem only occurs when mis-using GeneratedAggregate, then I think we should resolve this by adding an assertion / precondition check to GeneratedAggregate to ensure that codgen is enabled.
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.
@navis, can you comment on this?
I've closed the JIRA issue as "invalid" since GeneratedAggregate will never be used when codegen is disabled. As a result, do you mind closing this issue? Thanks! |
Bump; can you please close this pull request? Thanks! |
When codegen is disabled, ClassCastException is thrown in some cases.