Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
1.18.0
-
None
Description
SPLIT_PART UDF from https://github.com/apache/drill/blob/eb63eadda9a7836d70513e10caec4664c42a1237/exec/java-exec/src/main/java/org/apache/drill/exec/expr/fn/impl/StringFunctions.java#L389
Don't work for the query that returns two or more rows, for example:
SELECT SPLIT_PART(A, ' ', 1) FROM (SELECT 'key1 value1' as A UNION SELECT 'key2 value2'
will throw an error, but
SELECT SPLIT_PART(A, ' ', 1) FROM (SELECT 'key1 value1' as A UNION SELECT 'key2 value2') limit 1
Will return the correct result.
It's reproducing also for real data without `union`, I add it's just for example.