[ 
https://issues.apache.org/jira/browse/DRILL-7818?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Mykhailo Surnyk updated DRILL-7818:
-----------------------------------
    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:
{code:java}
SELECT SPLIT_PART(A, ' ', 1) FROM (SELECT 'key1 value1' as A UNION SELECT 'key2 
value2'{code}
will throw an error, but 
{code:java}
SELECT SPLIT_PART(A, ' ', 1) FROM (SELECT 'key1 value1' as A UNION SELECT 'key2 
value2') limit 1{code}
Will return the correct result.

It's reproducing also for real data without `union`, I add it's just for 
example. 

  was:
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:
{code:java}
SELECT SPLIT_PART(A, ' ', 1) FROM (SELECT 'key1 value1' as A UNION SELECT 'key2 
value2'{code}

 will throw an error, but 
{code:java}
SELECT SPLIT_PART(A, ' ', 1) FROM (SELECT 'key1 value1' as A UNION SELECT 'key2 
value2') limit 1{code}

 Will return the correct result.

It's reproducing also for real data without `union`, I add it's just for 
example. 


> SplitPart (SPLIT_PART) UDF work correct only with one-row data
> --------------------------------------------------------------
>
>                 Key: DRILL-7818
>                 URL: https://issues.apache.org/jira/browse/DRILL-7818
>             Project: Apache Drill
>          Issue Type: Bug
>          Components: Functions - Drill
>    Affects Versions: 1.18.0
>            Reporter: Mykhailo Surnyk
>            Priority: Major
>             Fix For: 1.19.0
>
>
> 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:
> {code:java}
> SELECT SPLIT_PART(A, ' ', 1) FROM (SELECT 'key1 value1' as A UNION SELECT 
> 'key2 value2'{code}
> will throw an error, but 
> {code:java}
> SELECT SPLIT_PART(A, ' ', 1) FROM (SELECT 'key1 value1' as A UNION SELECT 
> 'key2 value2') limit 1{code}
> Will return the correct result.
> It's reproducing also for real data without `union`, I add it's just for 
> example. 



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to