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

Wrong function's implementation of concat_delim

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.20.1
    • 1.21.0
    • Functions - Drill
    • None

    Description

      Current function implementation of `concat_delim` is wrong.

      select concat_delim(',', 'a', null, 'b') as c 

      We may want the result of 'a,b', which ignore null value during executing.

       

      But, actual result is 'a,,b'.
      I found the similar function(concat_ws) in MySQL and Postgres, and the behavior is what I wish.

       


       

      @Test
      public void testConcatDelimVarArgsWithNullValue() throws Exception {
        testBuilder()
          .sqlQuery("select concat_delim(',', 'a', null, 'b') as c")
          .unOrdered()
          .baselineColumns("c")
          .baselineValues("a,b")
          .go();
      }
      
      

       

      Attachments

        Activity

          People

            Unassigned Unassigned
            wojustme Xurenhe
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: