code: def json_object_agg(
      on_null: JsonOnNull,
      key_expr: Union[str, Expression[str]],
      value_expr,
  ) -> Expression:
      """
      Builds a JSON object string by aggregating key-value expressions into a single JSON object.
  
      The key expression must return a non-nullable character string. Value expressions can be
      arbitrary, including other JSON functions. If a value is `NULL`, the `on_null` behavior defines
      what to do.
  
      Note that keys must be unique. If a key occurs multiple times, an error will be thrown.
  
      This function is currently not supported in `OVER` windows.
  
      Examples:
      ::
  
          >>> # '{"Apple":2,"Banana":17,"Orange":0}'
          >>> orders.select(json_object_agg(JsonOnNull.NULL, col("product"), col("cnt")))
      """
      return _ternary_op(
          "jsonObjectAgg",
          on_null._to_j_json_on_null(),
          key_expr,
          value_expr,
      )
  
imports: from typing import Union
  from pyflink import add_version_doc
  from pyflink.java_gateway import get_gateway
  from pyflink.table.expression import Expression, _get_java_expression, TimePointUnit, JsonOnNull
  from pyflink.table.types import _to_java_data_type, DataType
  from pyflink.table.udf import UserDefinedFunctionWrapper
  from pyflink.util.java_utils import to_jarray, load_java_class
label_desc: Use image node_id 54 for calling a global function with example usage: json_object_agg(on_null, key_expr, value_expr) and returns: _ternary_op