RPAD (Lakehouse v1)
Returns the string str, right-padded with the string padstr to a length of len characters. If str is longer than len, the return value is shortened to len characters.
Analyze Syntax
Section titled “Analyze Syntax”func.rpad(<str>, <len>, <padstr>)Analyze Examples
Section titled “Analyze Examples”func.rpad('hi',5,'?')┌───────────────────────┐│ func.rpad('hi',5,'?') │├───────────────────────┤│ hi??? │└───────────────────────┘
func.rpad('hi',1,'?')┌───────────────────────┐│ func.rpad('hi',1,'?') │├───────────────────────┤│ h │└───────────────────────┘SQL Syntax
Section titled “SQL Syntax”RPAD(<str>, <len>, <padstr>)Arguments
Section titled “Arguments”| Arguments | Description |
|---|---|
<str> | The string. |
<len> | The length. |
<padstr> | The pad string. |
Return Type
Section titled “Return Type”VARCHAR
SQL Examples
Section titled “SQL Examples”SELECT RPAD('hi',5,'?');┌────────────────────┐│ RPAD('hi', 5, '?') │├────────────────────┤│ hi??? │└────────────────────┘
SELECT RPAD('hi',1,'?');┌────────────────────┐│ RPAD('hi', 1, '?') │├────────────────────┤│ h │└────────────────────┘