Skip to content

Add simplification rules for the CONCAT function#3684

Merged
alamb merged 4 commits into
apache:masterfrom
HaoYang670:3683_concat_contiguous_literals
Oct 11, 2022
Merged

Add simplification rules for the CONCAT function#3684
alamb merged 4 commits into
apache:masterfrom
HaoYang670:3683_concat_contiguous_literals

Conversation

@HaoYang670

@HaoYang670 HaoYang670 commented Oct 3, 2022

Copy link
Copy Markdown
Contributor

Signed-off-by: remzi 13716567376yh@gmail.com

Which issue does this PR close?

Closes #3683 .

Rationale for this change

What changes are included in this PR?

  1. cast all scalar values to utf8
  2. drop null values
  3. concatenate contiguous scalar values

Are there any user-facing changes?

Signed-off-by: remzi <13716567376yh@gmail.com>
@github-actions github-actions Bot added the optimizer Optimizer rules label Oct 3, 2022
Comment thread datafusion/optimizer/src/simplify_expressions.rs Outdated
@alamb alamb changed the title Simplify the CONCAT function Add simplification rules for the CONCAT function Oct 3, 2022
Comment thread datafusion/optimizer/src/simplify_expressions.rs Outdated
@HaoYang670 HaoYang670 marked this pull request as draft October 5, 2022 03:44
@HaoYang670

Copy link
Copy Markdown
Contributor Author

Mark the PR as a draft because the type-coercion rule for concat hasn't been added yet.

@HaoYang670

Copy link
Copy Markdown
Contributor Author

File #3720 to add type coercion rule.

@HaoYang670 HaoYang670 marked this pull request as ready for review October 9, 2022 09:58
@HaoYang670 HaoYang670 requested a review from alamb October 10, 2022 01:01

@alamb alamb left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This is great -- thanks @HaoYang670

lit(""),
null,
]);
let expected = build_concat_expr(&[col("c0"), lit("hello rust"), col("c1")]);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

this is very clever

@alamb alamb merged commit ac1631a into apache:master Oct 11, 2022
@ursabot

ursabot commented Oct 11, 2022

Copy link
Copy Markdown

Benchmark runs are scheduled for baseline = 0cf5630 and contender = ac1631a. ac1631a is a master commit associated with this PR. Results will be available as each benchmark for each run completes.
Conbench compare runs links:
[Skipped ⚠️ Benchmarking of arrow-datafusion-commits is not supported on ec2-t3-xlarge-us-east-2] ec2-t3-xlarge-us-east-2
[Skipped ⚠️ Benchmarking of arrow-datafusion-commits is not supported on test-mac-arm] test-mac-arm
[Skipped ⚠️ Benchmarking of arrow-datafusion-commits is not supported on ursa-i9-9960x] ursa-i9-9960x
[Skipped ⚠️ Benchmarking of arrow-datafusion-commits is not supported on ursa-thinkcentre-m75q] ursa-thinkcentre-m75q
Buildkite builds:
Supported benchmarks:
ec2-t3-xlarge-us-east-2: Supported benchmark langs: Python, R. Runs only benchmarks with cloud = True
test-mac-arm: Supported benchmark langs: C++, Python, R
ursa-i9-9960x: Supported benchmark langs: Python, R, JavaScript
ursa-thinkcentre-m75q: Supported benchmark langs: C++, Java

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

optimizer Optimizer rules

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Concatenate contiguous literal arguments of CONCAT during the expression simplification.

3 participants