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

[Feature][SDK] Transform supports padding of left and right strings #10927

Closed
2 tasks done
Zkplo opened this issue Aug 28, 2024 · 0 comments · Fixed by #10928
Closed
2 tasks done

[Feature][SDK] Transform supports padding of left and right strings #10927

Zkplo opened this issue Aug 28, 2024 · 0 comments · Fixed by #10928
Assignees
Milestone

Comments

@Zkplo
Copy link
Contributor

Zkplo commented Aug 28, 2024

Description

RPAD(s1,len,s2):Fill string s2 at the end of string s1 to make the length of the string len
LPAD(s1,len,s2):Fill string s2 at the beginning of string s1 to make the string length len

Use case

RPAD('12',5,'34') -> "12343"
RPAD('1234',2,'5') -> "12"
RPAD('1',5,'') -> ""
RPAD(null,2,'34') or RPAD('12',null,'34') or RPAD('12',2,null) or RPAD('12',-1,'34') -> null

LPAD('12',5,'34') -> "34312"
LPAD('1234',2,'5') -> "12"
LPAD('1',5,'') -> ""
LPAD(null,2,'34') or LPAD('12',null,'34') or LPAD('12',2,null) or LPAD('12',-1,'34') -> null

Are you willing to submit PR?

  • Yes, I am willing to submit a PR!

Code of Conduct

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

Successfully merging a pull request may close this issue.

2 participants