-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
implement 'StringConcat' operator to support sql like "select 'aa' || 'b' " #2142
Conversation
cc @Dandandan @alamb @xudong963 @yjshen |
Great job! ❤ |
@jackwener thank you for your comment.
I prefer unify the outputs of |
@jackwener @renato2099
Seems here is a convention, I'll comply with it in later commit, thank you both. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @WinkerDu -- this is a nice addition
@alamb do you know why this PR generated e-mails to the dev@ mailing list? |
@wesm I am sorry but do not know why there were some emails from this PR to dev e. g. https://lists.apache.org/thread/tqv2x57xmzzrppl3zgox5rt2rhfyg8jz I vaguely remember getting an email from apache infra about "remailer" but I didn't read the details and now I can't seem to find it :( There appears to be at least one C++ github conversation that got forwarded too: https://lists.apache.org/thread/vr3yjrcrb01b8zh64dclfl4d2gcxfw0j |
It seems to have been a temporary INFRA hiccup (Iceberg had some issues, too https://lists.apache.org/thread/8f7xdfttk4xhfo7o66lwkpc4xzvx2vjz). If it starts happening again, we should open an INFRA Jira ticket. |
@alamb @jackwener @renato2099 PTAL, thank you.
|
@alamb PTAL, thank you. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM -- thanks @WinkerDu
let result = (0..ignore_null_array.len()) | ||
.into_iter() | ||
.map(|index| { | ||
if left.is_null(index) || right.is_null(index) { | ||
None | ||
} else { | ||
Some(ignore_null_array.value(index)) | ||
} | ||
}) | ||
.collect::<StringArray>(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As a future optimization it might be worth using the take
kernel https://docs.rs/arrow/11.1.0/arrow/compute/kernels/take/fn.take.html which is fairly well optimized / tries to avoid copying.
This is good for now though
… 'b' " (apache#2142) * implement stringconcat operator * snake case fix * support non-string concat & handle NULL * value -> array * string concat internal coercion * get NULL in right index of vec Co-authored-by: duripeng <[email protected]>
… 'b' " (apache#2142) * implement stringconcat operator * snake case fix * support non-string concat & handle NULL * value -> array * string concat internal coercion * get NULL in right index of vec Co-authored-by: duripeng <[email protected]>
Which issue does this PR close?
Closes #2141 .
Rationale for this change
df now has not implemented
StringConcat
operator, likeBut Postgres SQL will come out results like
What changes are included in this PR?
Reuse df build-in
concat
string expression to do it.Are there any user-facing changes?
No.