class_docstr: A collection of data which can be pre-processed in parallel on Spark.
class_docstr_tok: ["A","collection","of","data","which","can","be","pre-processed","in","parallel","on","Spark","."]
code: def _get_schema_class_name(self):
      class_name = (
          self.type["class_name"] if "class_name" in self.type else None
      )
      import pyspark
  
      spark_version = pyspark.version.__version__
      major_version = spark_version.split(".")[0]
  
      def func(pdf):
          pdf_schema = None
          spark_df_schema = None
          _class_name = class_name
          if not _class_name:
              _class_name = (
                  pdf.__class__.__module__
                  + "."
                  + pdf.__class__.__name__
              )
  
          if _class_name == "pandas.core.frame.DataFrame":
              schema = [
                  str(x) if not isinstance(x, str) else x
                  for x in pdf.columns
              ]
              pdf_schema = {"columns": schema, "dtypes": pdf.dtypes}
  
              if major_version >= "3":
                  from pyspark.sql.pandas.types import from_arrow_type
                  from pyspark.sql.types import StructType
  
                  if isinstance(schema, (list, tuple)):
                      import pyarrow as pa
  
                      arrow_schema = pa.Schema.from_pandas(
                          pdf, preserve_index=False
                      )
                      struct = StructType()
                      for name, field in zip(schema, arrow_schema):
                          struct.add(
                              name,
                              from_arrow_type(field.type),
                              nullable=field.nullable,
                          )
                      spark_df_schema = struct
  
          return (_class_name, pdf_schema, spark_df_schema)
  
      return self.rdd.map(lambda x: func(x)).first()
  
imports: from py4j.protocol import Py4JError
  from bigdl.orca.data.utils import *
  from bigdl.orca import OrcaContext
  from bigdl.dllib.utils.common import get_node_and_core_number, get_spark_sql_context, get_spark_context
  from bigdl.dllib.utils import nest
  from bigdl.dllib.utils.log4Error import invalidInputError
  import numpy
  from typing import TYPE_CHECKING, Any
  from typing import Callable, Dict, List, Optional, Tuple, Union
label_desc: Use image node_id 38 for calling the SparkXShards obj's underlying member method code with example usage: obj._get_schema_class_name() and returns: self, _class_name,  pdf_schema,  spark_df_schema