Is empty struct

Supported in: Batch

Returns true if the input is an empty struct, with recursive checking of inner arrays and structs.

Expression categories: Boolean

Declared arguments

  • Expression - Compute whether this struct is empty or has non-null fields.
    Expression<Struct>

Output type: Boolean

Examples

Example 1: Base case

Argument values:

  • Expression: struct
structOutput
{
airline: {
id: null,
name: null,
},
tail_no: null,
}
true
{
airline: {
id: NA,
name: null,
},
tail_no: null,
}
false

Example 2: Base case

Argument values:

  • Expression: struct
structOutput
{
airline: {
ids: null,
name: null,
},
tail_no: null,
}
true
{
airline: {
ids: [ null ],
name: null,
},
tail_no: null,
}
true
{
airline: {
ids: [ foo, bar ],
name: null,
},
tail_no: null,
}
false
{
airline: {
ids: [ foo, null ],
name: null,
},
tail_no: null,
}
false

Example 3: Base case

Argument values:

  • Expression: struct
structOutput
{
airline: {
name: null,
},
ids: null,
tail_no: null,
}
true

Example 4: Base case

Argument values:

  • Expression: struct
structOutput
{
airline: {
ids: {
 foo -> null,
},
name: null,
},
tail_no: null,
}
true
{
airline: {
ids: {
 foo -> bar,
},
name: null,
},
tail_no: null,
}
false
{
airline: {
ids: {
 foo -> bar,
 foo1 -> null,
},
name: null,
},
tail_no: null,
}
false

Example 5: Base case

Argument values:

  • Expression: struct
structOutput
{
airline: {
ids: [ {
airline: {
ids: [ null ]...
true
{
airline: {
ids: [ {
airline: {
ids: [ foo, bar...
false