code: def upsert_results(keys):
      """
      Retrieves the results from an upsert table sink.
      """
      gateway = get_gateway()
      j_keys = gateway.new_array(gateway.jvm.int, len(keys))
      for i in range(0, len(keys)):
          j_keys[i] = keys[i]
  
      results = gateway.jvm.RowCollector.getAndClearValues()
      return gateway.jvm.RowCollector.upsertResults(results, j_keys)
  
imports: import glob
  import os
  import unittest
  from py4j.java_gateway import java_import
  from pyflink.find_flink_home import _find_flink_source_root
  from pyflink.java_gateway import get_gateway
  from pyflink.table.sinks import TableSink
  from pyflink.table.types import _to_java_data_type
  from pyflink.util import java_utils
label_desc: Use image node_id 3 for calling a global function with example usage: upsert_results(keys) and returns: gateway