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
[SPARK-29854]lpad and rpad built in function should throw Error or Exception for invalid length value #27024
Conversation
@cloud-fan and @srowen , please review this PR. |
…ow Exception for invalid length value
ok to test |
@maropu , Thank you |
But, there are many functions having the same behaivour? e.g.,
Actually, implicit casts do so. |
yes , we need to discuss whether we need to handle or not. |
Yea, I think this behaivour is weird, but we just follow the hive behviour; We are planning to support ansi-compatible type coercion, so I think this issue will be resolved if that supported. cc: @gengliangwang @cloud-fan |
Test build #115885 has finished for PR 27024 at commit
|
in Hive : SELECT lpad('hihhhhhhhhhhhhhhhhhhhhhhh', 'Expected int', '????????????'); |
I just meant not the lpad behaivour but the type coercion behaivour;
If you want to fix this, I think we need to update the implicit cast logics instead of the lpad logic. |
oh , ok got it. |
We're closing this PR because it hasn't been updated in a while. This isn't a judgement on the merit of the PR in any way. It's just a way of keeping the PR queue manageable. |
This behavior LGTM under the ansi mode. We should also update |
Can one of the admins verify this patch? |
@07ARB Are you still here? Could you update this PR based on the @cloud-fan suggestion above? |
…tion for invalid length input ### What changes were proposed in this pull request? This PR intends to add trivial tests to check #27024 has already been fixed in the master. Closes #27024 ### Why are the changes needed? For test coverage. ### Does this PR introduce _any_ user-facing change? No. ### How was this patch tested? Added tests. Closes #28604 from maropu/SPARK-29854. Authored-by: Takeshi Yamamuro <yamamuro@apache.org> Signed-off-by: Takeshi Yamamuro <yamamuro@apache.org> (cherry picked from commit 7ca73f0) Signed-off-by: Takeshi Yamamuro <yamamuro@apache.org>
What changes were proposed in this pull request?
lpad and rpad built in function should throw Error or Exception for invalid length value Instead of empty string.
Why are the changes needed?
We should throw Error or Exception message, if user trying to perform LPAD/RPAD operation using invalid argument.
Does this PR introduce any user-facing change?
YES
How was this patch tested?
Added new test case to check invalid length value.