code: def _merge_selected_columns(
      self, selected_columns: List[Any], op: OperandType
  ):
      input_node = self._graph.predecessors(op.outputs[0])[0]
      original_node = self._records.get_original_entity(input_node)
      if original_node is None:
          # not pruned before
          original_all_columns = input_node.dtypes.index.tolist()
          if set(selected_columns) != set(original_all_columns):
              # not prune all fields
              return [
                  c
                  for c in original_all_columns
                  if c in selected_columns
              ]
          else:
              return []
      else:
          # pruned before
          original_all_columns = original_node.dtypes.index.tolist()
          original_pruned_columns = input_node.op.get_columns()
          pruned_columns_set = set(selected_columns) | set(
              original_pruned_columns
          )
          # pruned before, cannot revert it,
          # so we just return pruned columns
          # even though no columns pruned
          return [
              c for c in original_all_columns if c in pruned_columns_set
          ]
  
file_path: mars/mars/optimization/logical/common/column_pruning.py
imports: from abc import ABCMeta, abstractmethod
  from typing import Any, List
  from ..core import OperandBasedOptimizationRule, OptimizationRecord, OptimizationRecordType
  from ....core import OperandType, TileableType, CHUNK_TYPE
  from ....dataframe.datasource.core import ColumnPruneSupportedDataSourceMixin
  from ....dataframe.utils import parse_index
  from ....utils import implements
label_desc: Use image node_id 5 for calling the PruneDataSource obj's underlying member method code with example usage: obj._merge_selected_columns(selected_columns, op) and returns: unknown, unknown, list