[ https://issues.apache.org/jira/browse/DRILL-8354?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17630639#comment-17630639 ]
ASF GitHub Bot commented on DRILL-8354: --------------------------------------- cgivre opened a new pull request, #2703: URL: https://github.com/apache/drill/pull/2703 # [DRILL-8354](https://issues.apache.org/jira/browse/DRILL-8354): Add IS_EMPTY Function ## Description 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. ## Documentation See above. ## Testing Added unit tests. > 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 > Priority: Major > 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)