Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
1.0.0
-
None
Description
In oracle and postgres, rpad and lpad functions defaults to spaces when str2 is not specified - rpad(str1, length [, str2]). For example in oracle:
SQL> select rpad(name,20) from voter where voter_id=10;
RPAD(NAME,20)
--------------------
tom underhill
SQL> select lpad(name,20) from voter where voter_id=10;
LPAD(NAME,20)
--------------------
tom underhill
In drill, the queries fail because the str2 parameter is required:
0: jdbc:drill:schema=dfs> relect lpad(name, 20) from voter where voter_id=10;
Query failed: org.apache.drill.exec.rpc.RpcException: Remote failure while running query.[error_id: "dde5cf1c-1d05-46c4-902a-c4bd6621c065"
endpoint {
address: "qa-node57.qa.lab"
user_port: 31010
control_port: 31011
data_port: 31012
}
error_type: 0
message: "Failure while parsing sql. < SqlParseException:[ Non-query expression encountered in illegal context ] < EigenbaseException:[ Non-query expression encountered in illegal context ]"
]