Skip to content

Conversation

@huaxingao
Copy link
Contributor

@huaxingao huaxingao commented Jul 27, 2022

What changes were proposed in this pull request?

When building V2 In Predicate in V2ExpressionBuilder, InSet.dataType (which is BooleanType) is used to build the LiteralValue, InSet.child.dataType should be used instead.

back port #37271 to 3.3

Why are the changes needed?

bug fix

Does this PR introduce any user-facing change?

no

How was this patch tested?

new test

@github-actions github-actions bot added the SQL label Jul 27, 2022
Copy link
Member

@dongjoon-hyun dongjoon-hyun left a comment

Choose a reason for hiding this comment

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

Hi, @huaxingao .

The PR description will be a commit message.

Please copy all the PR description to the backport PR and adds additional message like the following

back port #37271 to 3.3

"`a.b`.cint", // two level nested field, and top level contains `dot`
"`a.b`.`c.int`", // two level nested field, and both levels contain `dot`
"a.b.cint" // three level nested field
))
Copy link
Member

Choose a reason for hiding this comment

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

nit, to be clear, this is a backport of SPARK-39784 technically.

test("translate simple expression") { attrInts.zip(attrStrs)
.foreach { case ((attrInt, intColName), (attrStr, strColName)) =>
testTranslateFilter(EqualTo(attrInt, 1),
Some(new Predicate("=", Array(FieldReference(intColName), LiteralValue(1, IntegerType)))))
Copy link
Member

Choose a reason for hiding this comment

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

ditto. This is a backport of SPARK-39784 technically and is irrelevant to this PR's InSet contribution.

huaxingao added a commit that referenced this pull request Jul 28, 2022
…ue data type for In predicate

### What changes were proposed in this pull request?

When building V2 In `Predicate` in `V2ExpressionBuilder`, `InSet.dataType` (which is BooleanType) is used to build the `LiteralValue`, `InSet.child.dataType `should be used instead.

back port #37271 to 3.3

### Why are the changes needed?
bug fix

### Does this PR introduce _any_ user-facing change?
no

### How was this patch tested?
new test

Closes #37324 from huaxingao/backport.

Authored-by: huaxingao <[email protected]>
Signed-off-by: huaxingao <[email protected]>
@huaxingao
Copy link
Contributor Author

The GA status is unfinished, but the tests have been finished a while ago, so I will merge.

@huaxingao
Copy link
Contributor Author

Thank you very much @dongjoon-hyun for reviewing!

@huaxingao huaxingao closed this Jul 28, 2022
@huaxingao huaxingao deleted the backport branch July 28, 2022 01:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants