跳转至

Remove map entry by key(按键移除映射条目)

Supported in: Batch, Streaming

Removes a map entry by the given key.

Expression categories: Map

Declared arguments

  • Key: Key of the entry to remove.
    Expression\
  • Map: Map expression.
    Expression\>

Type variable bounds: K accepts AnyType**V accepts AnyType

Output type: Map\

Examples

Example 1: Base case

Argument values:

  • Key: k
  • Map: map_col
map_col Output
{
 a -> 1,
 k -> 2,
}
{
 a -> 1,
}

Example 2: Base case

Argument values:

  • Key: j
  • Map: map_col
map_col Output
{
 a -> 1,
 k -> 2,
}
{
 a -> 1,
 k -> 2,
}

Example 3: Null case

Argument values:

  • Key: k
  • Map: map_col
map_col Output
null null

Example 4: Null case

Argument values:

  • Key: null
  • Map: map_col
map_col Output
{
 a -> foo,
}
{
 a -> foo,
}


中文翻译


按键移除映射条目

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

根据指定键移除映射(Map)中的条目。

表达式类别: 映射(Map)

声明的参数

  • 键(Key): 要移除条目的键。
    表达式\
  • 映射(Map): 映射表达式。
    表达式\>

类型变量约束: K 接受任意类型(AnyType)**V 接受任意类型(AnyType)

输出类型: Map\

示例

示例 1:基础情况

参数值:

  • 键: k
  • 映射: map_col
map_col 输出
{
 a -> 1,
 k -> 2,
}
{
 a -> 1,
}

示例 2:基础情况

参数值:

  • 键: j
  • 映射: map_col
map_col 输出
{
 a -> 1,
 k -> 2,
}
{
 a -> 1,
 k -> 2,
}

示例 3:空值情况

参数值:

  • 键: k
  • 映射: map_col
map_col 输出
null null

示例 4:空值情况

参数值:

  • 键: null
  • 映射: map_col
map_col 输出
{
 a -> foo,
}
{
 a -> foo,
}