LPAD (Lakehouse v1)
Returns the string str, left-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.lpad(<str>, <len>, <padstr>)Analyze Examples
Section titled “Analyze Examples”func.lpad('hi',4,'??')┌────────────────────────┐│ func.lpad('hi',4,'??') │├────────────────────────┤│ ??hi │└────────────────────────┘func.lpad('hi',1,'??')┌────────────────────────┐│ func.lpad('hi',1,'??') │├────────────────────────┤│ h │└────────────────────────┘SQL Syntax
Section titled “SQL Syntax”LPAD(<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 LPAD('hi',4,'??');┌─────────────────────┐│ LPAD('hi', 4, '??') │├─────────────────────┤│ ??hi │└─────────────────────┘
SELECT LPAD('hi',1,'??');┌─────────────────────┐│ LPAD('hi', 1, '??') │├─────────────────────┤│ h │└─────────────────────┘