Skip to content

[SPARK-38432][SQL][FOLLOWUP] Fix problems in And/Or/Not to V2 Filter#36290

Closed
huaxingao wants to merge 1 commit intoapache:masterfrom
huaxingao:toV1
Closed

[SPARK-38432][SQL][FOLLOWUP] Fix problems in And/Or/Not to V2 Filter#36290
huaxingao wants to merge 1 commit intoapache:masterfrom
huaxingao:toV1

Conversation

@huaxingao
Copy link
Copy Markdown
Contributor

What changes were proposed in this pull request?

Instead of having

override def toV2: Predicate = new Predicate("AND", Seq(left, right).map(_.toV2).toArray)

I think we should construct a V2 And directly.

override def toV2: Predicate = new org.apache.spark.sql.connector.expressions.filter.And(left.toV2, right.toV2)

same for Or and Not.

Why are the changes needed?

bug fixing

Does this PR introduce any user-facing change?

No

How was this patch tested?

New tests

@github-actions github-actions bot added the SQL label Apr 20, 2022
@huaxingao
Copy link
Copy Markdown
Contributor Author

cc @beliefer @cloud-fan

Copy link
Copy Markdown
Contributor

@beliefer beliefer left a comment

Choose a reason for hiding this comment

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

LGTM. @huaxingao Thank you.

@cloud-fan
Copy link
Copy Markdown
Contributor

thanks, merging to master/3.3!

cloud-fan pushed a commit that referenced this pull request Apr 21, 2022
### What changes were proposed in this pull request?
Instead of having
```
override def toV2: Predicate = new Predicate("AND", Seq(left, right).map(_.toV2).toArray)
```
I think we should construct a V2 `And` directly.
```
override def toV2: Predicate = new org.apache.spark.sql.connector.expressions.filter.And(left.toV2, right.toV2)
```
same for `Or` and `Not`.

### Why are the changes needed?
bug fixing

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

### How was this patch tested?
New tests

Closes #36290 from huaxingao/toV1.

Authored-by: huaxingao <huaxin_gao@apple.com>
Signed-off-by: Wenchen Fan <wenchen@databricks.com>
(cherry picked from commit 36fc8bd)
Signed-off-by: Wenchen Fan <wenchen@databricks.com>
@cloud-fan cloud-fan closed this in 36fc8bd Apr 21, 2022
@huaxingao
Copy link
Copy Markdown
Contributor Author

Thanks! @beliefer @cloud-fan

@huaxingao huaxingao deleted the toV1 branch April 21, 2022 14:51
lvshaokang pushed a commit to lvshaokang/spark that referenced this pull request Apr 22, 2022
### What changes were proposed in this pull request?
Instead of having
```
override def toV2: Predicate = new Predicate("AND", Seq(left, right).map(_.toV2).toArray)
```
I think we should construct a V2 `And` directly.
```
override def toV2: Predicate = new org.apache.spark.sql.connector.expressions.filter.And(left.toV2, right.toV2)
```
same for `Or` and `Not`.

### Why are the changes needed?
bug fixing

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

### How was this patch tested?
New tests

Closes apache#36290 from huaxingao/toV1.

Authored-by: huaxingao <huaxin_gao@apple.com>
Signed-off-by: Wenchen Fan <wenchen@databricks.com>
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.

3 participants