code: def get_distinct_keys(df, col_name, is_col_arr_map=False):
      """Return list of distinct keys.
      Set is_col_arr_map to be true if column is an array of Maps.
      Otherwise, assume column is a Map.
      """
      if is_col_arr_map:
          df = df.select(explode(col_name).alias(col_name))
      df = df.select(explode(map_keys(col_name)))
      return df.distinct().rdd.flatMap(lambda x: x).collect()
  
imports: import logging
  from typing import List, Optional, Tuple
  from pyspark.sql.functions import col, crc32, explode, map_keys, udf
  from pyspark.sql.types import ArrayType, BooleanType, FloatType, LongType, MapType, StructField, StructType
  from reagent.data.data_fetcher import DataFetcher
  from reagent.data.spark_utils import get_spark_session, get_table_url
  from reagent.workflow.types import Dataset, TableSpec
label_desc: Use image node_id 15 for calling a global function with example usage: get_distinct_keys(df, col_name, is_col_arr_map) and returns: df