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

Handle null as input to window function NTILE

    XMLWordPrintableJSON

Details

    Description

      We need to handle null as input to window functions. NTILE function must return null as output when input is null.

      0: jdbc:drill:schema=dfs.tmp> select col7 , col0 , ntile(null) over(partition by col7 order by col0) lead_col0 from FEWRWSPQQ_101;
      Error: PARSE ERROR: From line 1, column 22 to line 1, column 37: Argument to function 'NTILE' must not be NULL
      
      
      [Error Id: e5e69582-8502-4a99-8ba1-dffdfb8ac028 on centos-04.qa.lab:31010] (state=,code=0)
      
      0: jdbc:drill:schema=dfs.tmp> select col7 , col0 , lead(null) over(partition by col7 order by col0) lead_col0 from FEWRWSPQQ_101;
      Error: PARSE ERROR: From line 1, column 27 to line 1, column 30: Illegal use of 'NULL'
      
      
      [Error Id: 6824ca01-e3f1-4338-b4c8-5535e7a42e13 on centos-04.qa.lab:31010] (state=,code=0)
      

      Attachments

        Activity

          People

            Unassigned Unassigned
            khfaraaz Khurram Faraaz
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: