code: def df_merge_select_function(tileable_data: TileableData) -> Set[Any]:
      """
      Make sure the merge keys are preserved.
      """
  
      op: DataFrameMerge = tileable_data.op
      on = op.on
      if on is not None:
          return get_cols_exclude_index(tileable_data, on)
  
      ret = set()
      left_data: BaseDataFrameData = op.inputs[0]
      right_data: BaseDataFrameData = op.inputs[1]
      left_index = op.left_index
      right_index = op.right_index
      left_on = (
          op.left_on if isinstance(op.left_on, list) else [op.left_on]
      )
      right_on = (
          op.right_on
          if isinstance(op.right_on, list)
          else [op.right_on]
      )
  
      if left_index and right_index:
          return ret
  
      if left_index:
          for col in right_data.dtypes.index:
              if col in right_on:
                  ret.add(col)
          return ret
      if right_index:
          for col in left_data.dtypes.index:
              if col in left_on:
                  ret.add(col)
          return ret
  
      for data, merge_keys, suffix in zip(
          [left_data, right_data], [left_on, right_on], op.suffixes
      ):
          if merge_keys is None:
              continue
          for col in data.dtypes.index:
              if col in merge_keys:
                  other_data = (
                      right_data if data is left_data else left_data
                  )
                  other_merge_keys = (
                      right_on if merge_keys is left_on else left_on
                  )
  
                  if (
                      col in other_data.dtypes.index
                      and col not in other_merge_keys
                  ):
                      # if the merge key exists in the other dataframe but not in the other
                      # dataframe's merge keys, suffixes will be added.
                      # TODO: this does not work when col is a tuple.
                      suffix_col = str(col) + suffix
                      ret.add(suffix_col)
                  else:
                      ret.add(col)
      return ret
  
file_path: mars/mars/optimization/logical/tileable/column_pruning/self_column_selector.py
imports: from typing import Set, Any, Callable
  from .utils import get_cols_exclude_index
  from .....core import TileableData
  from .....dataframe.core import BaseDataFrameData, BaseSeriesData
  from .....dataframe.groupby.aggregation import DataFrameGroupByAgg
  from .....dataframe.indexing.getitem import DataFrameIndex
  from .....dataframe.indexing.setitem import DataFrameSetitem
  from .....dataframe.merge import DataFrameMerge
  from .....typing import OperandType
label_desc: Use image node_id 5 for calling a global function with example usage: df_merge_select_function(tileable_data) and returns: ret, get_cols_exclude_index, ret, ret, ret