You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@drill.apache.org by "ASF GitHub Bot (Jira)" <ji...@apache.org> on 2020/12/14 18:03:00 UTC

[jira] [Commented] (DRILL-7818) SplitPart (SPLIT_PART) UDF work correct only with one-row data

    [ https://issues.apache.org/jira/browse/DRILL-7818?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17249178#comment-17249178 ] 

ASF GitHub Bot commented on DRILL-7818:
---------------------------------------

dcmsurnyk opened a new pull request #2126:
URL: https://github.com/apache/drill/pull/2126


   
   # [DRILL-7818](https://issues.apache.org/jira/browse/DRILL-7818): SplitPart (SPLIT_PART) UDF work correct only with one-row data
   
   
   ## Description
   
   Was rewritten `SPLIT_PART` UDF, as the previous version worked correctly only with one-row data
   
   ## Documentation
   There are no changes visible to the user.
   
   ## Testing
   `testSplitPart()` from `TestStringFunctions.java` was updated;
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


> 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)