You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@drill.apache.org by "Charles Givre (Jira)" <ji...@apache.org> on 2022/11/08 22:11:00 UTC

[jira] [Created] (DRILL-8354) Add IS_EMPTY Function.

Charles Givre created DRILL-8354:
------------------------------------

             Summary: Add IS_EMPTY Function.
                 Key: DRILL-8354
                 URL: https://issues.apache.org/jira/browse/DRILL-8354
             Project: Apache Drill
          Issue Type: Improvement
          Components: Functions - Drill
    Affects Versions: 1.20.2
            Reporter: Charles Givre
            Assignee: Charles Givre
             Fix For: 2.0.0


When analyzing data, there is currently no single function to evaluate whether a given field is empty.  With scalar fields, this can be accomplished with the `IS NOT NULL` operator, but with complex fields, this is more challenging as complex fields are never null. 

This PR adds a UDF called IS_EMPTY() which accepts any type of field and returns true if the field does not contain data.  

 

In the case of scalar fields, if the field is `null` this returns true.  In the case of complex fields, which can never be `null`, in the case of lists, the function returns true if the list is empty.  In the case of maps, it returns true if all of the map's fields are unpopulated. 



--
This message was sent by Atlassian Jira
(v8.20.10#820010)