Skip to content

Conversation

@jayzhan211
Copy link
Contributor

Which issue does this PR close?

Part of #8506 #10534

Rationale for this change

Move the rewrite from optimizer to sql crate

I keep the function rewrite trait even it is not used anywhere in datafusion now.

What changes are included in this PR?

Are these changes tested?

Are there any user-facing changes?

Signed-off-by: jayzhan211 <[email protected]>
@github-actions github-actions bot added sql SQL Planner logical-expr Logical plan and expressions labels Jun 28, 2024
Signed-off-by: jayzhan211 <[email protected]>
@jayzhan211 jayzhan211 marked this pull request as ready for review June 28, 2024 06:03
@alamb alamb mentioned this pull request Jun 28, 2024
6 tasks
Copy link
Contributor

@alamb alamb left a comment

Choose a reason for hiding this comment

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

Thanks @jayzhan211 -- this looks good to me

Can you remind me why this method is preferrable to the FunctionRewrite idea we previously had?

I feel this PR and changes are related to the one from @samuelcolvin on #11137 -- where the idea is to support SQL syntax with JSON operators without putting the implementation into SQL

}

#[test]
fn select_at_arrow_operator() {
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we add an explain test?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't think it is needed since we don't really care about how it looks in plan.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Maybe we can make sure array_has_all is applied 🤔

@alamb
Copy link
Contributor

alamb commented Jun 28, 2024

Here is an alternate idea #11168

@jayzhan211
Copy link
Contributor Author

Thanks @jayzhan211 -- this looks good to me

Can you remind me why this method is preferrable to the FunctionRewrite idea we previously had?

I feel this PR and changes are related to the one from @samuelcolvin on #11137 -- where the idea is to support SQL syntax with JSON operators without putting the implementation into SQL

From your comment here :) #10534 (comment)

Signed-off-by: jayzhan211 <[email protected]>
@github-actions github-actions bot added the sqllogictest SQL Logic Tests (.slt) label Jun 29, 2024
Signed-off-by: jayzhan211 <[email protected]>
}

#[cfg(test)]
mod tests {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

forgot to remove in previous PR

@jayzhan211 jayzhan211 merged commit 14d3973 into apache:main Jun 29, 2024
@jayzhan211 jayzhan211 deleted the at-arrow-rewrite branch June 29, 2024 12:14
findepi pushed a commit to findepi/datafusion that referenced this pull request Jul 16, 2024
…expr (apache#11155)

* rewrite at arrow

Signed-off-by: jayzhan211 <[email protected]>

* rm useless test

Signed-off-by: jayzhan211 <[email protected]>

* add test

Signed-off-by: jayzhan211 <[email protected]>

* rm test

Signed-off-by: jayzhan211 <[email protected]>

---------

Signed-off-by: jayzhan211 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

logical-expr Logical plan and expressions sql SQL Planner sqllogictest SQL Logic Tests (.slt)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants