Uploaded image for project: 'Apache Drill'
  1. Apache Drill
  2. DRILL-7818

SplitPart (SPLIT_PART) UDF work correct only with one-row data

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 1.18.0
    • 1.19.0
    • Functions - Drill
    • 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. 

      Attachments

        Activity

          People

            Unassigned Unassigned
            mSurnyk Mykhailo Surnyk
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: