跳转至

Is empty struct(是否为空结构体)

Supported in: Batch, Streaming

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\

Output type: Boolean

Examples

Example 1: Base case

Argument values:

  • Expression: struct
struct Output
{
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
struct Output
{
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
struct Output
{
airline: {
name: null,
},
ids: null,
tail_no: null,
}
true

Example 4: Base case

Argument values:

  • Expression: struct
struct Output
{
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
struct Output
{
airline: {
ids: [ {
airline: {
ids: [ null ]...
true
{
airline: {
ids: [ {
airline: {
ids: [ foo, bar...
false


中文翻译

是否为空结构体

支持:批处理(Batch)、流处理(Streaming)

如果输入是一个空结构体,则返回 true,并递归检查内部数组和结构体。

表达式类别: 布尔型(Boolean)

声明的参数

  • 表达式(Expression): 计算此结构体是否为空或包含非空字段。
    表达式\<结构体>(Expression\

输出类型: 布尔型(Boolean)

示例

示例 1:基本情况

参数值:

  • 表达式: struct
struct 输出
{
airline: {
id: null,
name: null,
},
tail_no: null,
}
true
{
airline: {
id: NA,
name: null,
},
tail_no: null,
}
false

示例 2:基本情况

参数值:

  • 表达式: struct
struct 输出
{
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

示例 3:基本情况

参数值:

  • 表达式: struct
struct 输出
{
airline: {
name: null,
},
ids: null,
tail_no: null,
}
true

示例 4:基本情况

参数值:

  • 表达式: struct
struct 输出
{
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

示例 5:基本情况

参数值:

  • 表达式: struct
struct 输出
{
airline: {
ids: [ {
airline: {
ids: [ null ]...
true
{
airline: {
ids: [ {
airline: {
ids: [ foo, bar...
false