Skip to content
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

Update concat_ws scalar function to support Utf8View #12309

Merged
merged 21 commits into from
Sep 12, 2024

Conversation

devanbenz
Copy link
Contributor

Which issue does this PR close?

Closes #11837

Rationale for this change

What changes are included in this PR?

Are these changes tested?

Are there any user-facing changes?

@github-actions github-actions bot added sqllogictest SQL Logic Tests (.slt) functions labels Sep 4, 2024
Signed-off-by: Devan <[email protected]>
@alamb alamb marked this pull request as draft September 5, 2024 14:42
@alamb
Copy link
Contributor

alamb commented Sep 5, 2024

Marking as draft as it looks like we are still working out the CI checks

@github-actions github-actions bot added logical-expr Logical plan and expressions optimizer Optimizer rules labels Sep 8, 2024
Signed-off-by: Devan <[email protected]>
@github-actions github-actions bot removed the logical-expr Logical plan and expressions label Sep 8, 2024
Signed-off-by: Devan <[email protected]>
Signed-off-by: Devan <[email protected]>
Signed-off-by: Devan <[email protected]>
Signed-off-by: Devan <[email protected]>
@github-actions github-actions bot removed the optimizer Optimizer rules label Sep 8, 2024
Signed-off-by: Devan <[email protected]>
@devanbenz devanbenz marked this pull request as ready for review September 8, 2024 18:10
@devanbenz devanbenz requested a review from alamb September 8, 2024 18:10
DataType::Utf8View => {
let string_array = as_string_view_array(array)?;

data_size += string_array.len();
Copy link
Contributor

Choose a reason for hiding this comment

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

data_size is the estimated string array size after concatenation, I think here it should increment sum of inner buffers' size instead

(And everything else LGTM)

Copy link
Contributor Author

@devanbenz devanbenz Sep 9, 2024

Choose a reason for hiding this comment

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

Using data_size += string_array.data_buffers().len(); ?

disregard I think I get what you mean I modified it to sum up the inner buffer vec on each iteration and use that as the size

Copy link
Contributor

@2010YOUY01 2010YOUY01 left a comment

Choose a reason for hiding this comment

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

Awesome! Thank you

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.

Thank you @devanbenz -- this looks great to me

Thank you @2010YOUY01 for the review

@@ -796,7 +796,7 @@ EXPLAIN SELECT
FROM test;
----
logical_plan
01)Projection: concat_ws(Utf8(", "), CAST(test.column1_utf8view AS Utf8), CAST(test.column2_utf8view AS Utf8)) AS c
01)Projection: concat_ws(Utf8(", "), test.column1_utf8view, test.column2_utf8view) AS c
Copy link
Contributor

Choose a reason for hiding this comment

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

❤️

@alamb alamb merged commit 199d028 into apache:main Sep 12, 2024
24 checks passed
@alamb
Copy link
Contributor

alamb commented Sep 12, 2024

Thanks again @devanbenz and @2010YOUY01

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
functions sqllogictest SQL Logic Tests (.slt)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update concat_ws scalar function to support Utf8View
3 participants