implement 'StringConcat' operator to support sql like "select 'aa' || 'b' "#2142
implement 'StringConcat' operator to support sql like "select 'aa' || 'b' "#2142alamb merged 6 commits intoapache:masterfrom
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. |
|
@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. |
| 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.
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 <duripeng@baidu.com>
… '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 <duripeng@baidu.com>
Which issue does this PR close?
Closes #2141 .
Rationale for this change
df now has not implemented
StringConcatoperator, likeBut Postgres SQL will come out results like
What changes are included in this PR?
Reuse df build-in
concatstring expression to do it.Are there any user-facing changes?
No.