code: def _merge_cols_for_spark_df(
      data: Union["DataFrame", Tuple["ndarray", "ndarray"], "partial"],
      validation_data: Optional[
          Union["partial", Tuple["ndarray", "ndarray"], "DataFrame"]
      ],
      feature_cols: Optional[List[str]],
      label_cols: Optional[List[str]],
  ) -> Tuple:
      # merge feature_cols/label_cols to one column, to adapt to the meanings of feature_cols and
      # label_cols in AutoEstimator, which correspond to the model inputs/outputs.
      from pyspark.sql import DataFrame
      from pyspark.sql.functions import array
  
      def concat_cols(data, feature_cols, label_cols):
          combined_feature_name = "combined_features"
          combined_target_name = "combined_targets"
          data = data.select(
              array(*feature_cols).alias(combined_feature_name),
              array(*label_cols).alias(combined_target_name),
          )
          return data, combined_feature_name, combined_target_name
  
      (
          feature_cols,
          label_cols,
      ) = AutoEstimator._check_spark_dataframe_input(
          data, validation_data, feature_cols, label_cols
      )
      if isinstance(data, DataFrame):
          (
              data,
              combined_feature_name,
              combined_target_name,
          ) = concat_cols(data, feature_cols, label_cols)
          if validation_data is not None:
              validation_data, _, _ = concat_cols(
                  validation_data, feature_cols, label_cols
              )
          feature_cols = [combined_feature_name]
          label_cols = [combined_target_name]
      return data, validation_data, feature_cols, label_cols
  
file_path: BigDL/python/orca/src/bigdl/orca/automl/xgboost/auto_xgb.py
imports: from bigdl.orca.automl.xgboost.XGBoost import XGBoostModelBuilder
  from bigdl.orca.automl.auto_estimator import AutoEstimator
  from typing import TYPE_CHECKING, Callable, Dict, List, Optional, Tuple, Union
label_desc: Use image node_id 1 for calling a global function with example usage: _merge_cols_for_spark_df(data, validation_data, feature_cols, label_cols) and returns: data,  validation_data,  feature_cols,  label_cols, data,  combined_feature_name,  combined_target_name