class_docstr: The entry point for working with structured data (rows and columns) in Spark, in Spark 1.x.
  
  As of Spark 2.0, this is replaced by :class:`SparkSession`. However, we are keeping the class
  here for backward compatibility.
  
  A SQLContext can be used to create :class:`DataFrame`, register :class:`DataFrame` as
  tables, execute SQL over tables, cache tables, and read parquet files.
  
  .. deprecated:: 3.0.0
      Use :func:`SparkSession.builder.getOrCreate()` instead.
  
  Parameters
  ----------
  sparkContext : :class:`SparkContext`
      The :class:`SparkContext` backing this SQLContext.
  sparkSession : :class:`SparkSession`
      The :class:`SparkSession` around which this SQLContext wraps.
  jsqlContext : optional
      An optional JVM Scala SQLContext. If set, we do not instantiate a new
      SQLContext in the JVM, instead we make all calls to this object.
      This is only for internal.
  
  Examples
  --------
  >>> from datetime import datetime
  >>> from pyspark.sql import Row
  >>> sqlContext = SQLContext(sc)
  >>> allTypes = sc.parallelize([Row(i=1, s="string", d=1.0, l=1,
  ...     b=True, list=[1, 2, 3], dict={"s": 0}, row=Row(a=1),
  ...     time=datetime(2014, 8, 1, 14, 1, 5))])
  >>> df = allTypes.toDF()
  >>> df.createOrReplaceTempView("allTypes")
  >>> sqlContext.sql('select i+1, d+1, not b, list[1], dict["s"], time, row.a '
  ...            'from allTypes where b and i > 0').collect()
  [Row((i + 1)=2, (d + 1)=2.0, (NOT b)=False, list[1]=2,         dict[s]=0, time=datetime.datetime(2014, 8, 1, 14, 1, 5), a=1)]
  >>> df.rdd.map(lambda x: (x.i, x.s, x.d, x.l, x.b, x.time, x.row.a, x.list)).collect()
  [(1, 'string', 1.0, 1, True, datetime.datetime(2014, 8, 1, 14, 1, 5), 1, [1, 2, 3])]
class_docstr_tok: ["The","entry","point","for","working","with","structured","data","(","rows","and","columns",")","in","Spark",",","in","Spark","1.x",".","As","of","Spark","2.0",",","this","is","replaced","by",":","class",":","`","SparkSession","`",".","However",",","we","are","keeping","the","class","here","for","backward","compatibility",".","A","SQLContext","can","be","used","to","create",":","class",":","`","DataFrame","`",",","register",":","class",":","`","DataFrame","`","as","tables",",","execute","SQL","over","tables",",","cache","tables",",","and","read","parquet","files",".","..","deprecated",":",":","3.0.0","Use",":","func",":","`","SparkSession.builder.getOrCreate","(",")","`","instead",".","Parameters","--","--","--","--","--","sparkContext",":",":","class",":","`","SparkContext","`","The",":","class",":","`","SparkContext","`","backing","this","SQLContext",".","sparkSession",":",":","class",":","`","SparkSession","`","The",":","class",":","`","SparkSession","`","around","which","this","SQLContext","wraps",".","jsqlContext",":","optional","An","optional","JVM","Scala","SQLContext",".","If","set",",","we","do","not","instantiate","a","new","SQLContext","in","the","JVM",",","instead","we","make","all","calls","to","this","object",".","This","is","only","for","internal",".","Examples","--","--","--","--",">",">",">","from","datetime","import","datetime",">",">",">","from","pyspark.sql","import","Row",">",">",">","sqlContext","=","SQLContext","(","sc",")",">",">",">","allTypes","=","sc.parallelize","(","[","Row","(","i=1",",","s=","''","string","''",",","d=1.0",",","l=1",",","...","b=True",",","list=","[","1",",","2",",","3","]",",","dict=","{","``","s","''",":","0","}",",","row=Row","(","a=1",")",",","...","time=datetime","(","2014",",","8",",","1",",","14",",","1",",","5",")",")","]",")",">",">",">","df","=","allTypes.toDF","(",")",">",">",">","df.createOrReplaceTempView","(","``","allTypes","''",")",">",">",">","sqlContext.sql","(","'select","i+1",",","d+1",",","not","b",",","list","[","1","]",",","dict","[","``","s","''","]",",","time",",","row.a","'","...","'from","allTypes","where","b","and","i",">","0","'",")",".collect","(",")","[","Row","(","(","i","+","1",")","=2",",","(","d","+","1",")","=2.0",",","(","NOT","b",")","=False",",","list","[","1","]","=2",",","dict","[","s","]","=0",",","time=datetime.datetime","(","2014",",","8",",","1",",","14",",","1",",","5",")",",","a=1",")","]",">",">",">","df.rdd.map","(","lambda","x",":","(","x.i",",","x.s",",","x.d",",","x.l",",","x.b",",","x.time",",","x.row.a",",","x.list",")",")",".collect","(",")","[","(","1",",","'string","'",",","1.0",",","1",",","True",",","datetime.datetime","(","2014",",","8",",","1",",","14",",","1",",","5",")",",","1",",","[","1",",","2",",","3","]",")","]"]
docstr: Creates a :class:`DataFrame` from an :class:`RDD`, a list or a :class:`pandas.DataFrame`.
  
  When ``schema`` is a list of column names, the type of each column
  will be inferred from ``data``.
  
  When ``schema`` is ``None``, it will try to infer the schema (column names and types)
  from ``data``, which should be an RDD of :class:`Row`,
  or :class:`namedtuple`, or :class:`dict`.
  
  When ``schema`` is :class:`pyspark.sql.types.DataType` or a datatype string it must match
  the real data, or an exception will be thrown at runtime. If the given schema is not
  :class:`pyspark.sql.types.StructType`, it will be wrapped into a
  :class:`pyspark.sql.types.StructType` as its only field, and the field name will be "value",
  each record will also be wrapped into a tuple, which can be converted to row later.
  
  If schema inference is needed, ``samplingRatio`` is used to determine the ratio of
  rows used for schema inference. The first row will be used if ``samplingRatio`` is ``None``.
  
  .. versionadded:: 1.3.0
  
  .. versionchanged:: 2.0.0
     The ``schema`` parameter can be a :class:`pyspark.sql.types.DataType` or a
     datatype string after 2.0.
     If it's not a :class:`pyspark.sql.types.StructType`, it will be wrapped into a
     :class:`pyspark.sql.types.StructType` and each record will also be wrapped into a tuple.
  
  .. versionchanged:: 2.1.0
     Added verifySchema.
  
  Parameters
  ----------
  data : :class:`RDD` or iterable
      an RDD of any kind of SQL data representation (:class:`Row`,
      :class:`tuple`, ``int``, ``boolean``, etc.), or :class:`list`, or
      :class:`pandas.DataFrame`.
  schema : :class:`pyspark.sql.types.DataType`, str or list, optional
      a :class:`pyspark.sql.types.DataType` or a datatype string or a list of
      column names, default is None.  The data type string format equals to
      :class:`pyspark.sql.types.DataType.simpleString`, except that top level struct type can
      omit the ``struct<>``.
  samplingRatio : float, optional
      the sample ratio of rows used for inferring
  verifySchema : bool, optional
      verify data types of every row against schema. Enabled by default.
  
  Returns
  -------
  :class:`DataFrame`
  
  Examples
  --------
  >>> l = [('Alice', 1)]
  >>> sqlContext.createDataFrame(l).collect()
  [Row(_1='Alice', _2=1)]
  >>> sqlContext.createDataFrame(l, ['name', 'age']).collect()
  [Row(name='Alice', age=1)]
  
  >>> d = [{'name': 'Alice', 'age': 1}]
  >>> sqlContext.createDataFrame(d).collect()
  [Row(age=1, name='Alice')]
  
  >>> rdd = sc.parallelize(l)
  >>> sqlContext.createDataFrame(rdd).collect()
  [Row(_1='Alice', _2=1)]
  >>> df = sqlContext.createDataFrame(rdd, ['name', 'age'])
  >>> df.collect()
  [Row(name='Alice', age=1)]
  
  >>> from pyspark.sql import Row
  >>> Person = Row('name', 'age')
  >>> person = rdd.map(lambda r: Person(*r))
  >>> df2 = sqlContext.createDataFrame(person)
  >>> df2.collect()
  [Row(name='Alice', age=1)]
  
  >>> from pyspark.sql.types import *
  >>> schema = StructType([
  ...    StructField("name", StringType(), True),
  ...    StructField("age", IntegerType(), True)])
  >>> df3 = sqlContext.createDataFrame(rdd, schema)
  >>> df3.collect()
  [Row(name='Alice', age=1)]
  
  >>> sqlContext.createDataFrame(df.toPandas()).collect()  # doctest: +SKIP
  [Row(name='Alice', age=1)]
  >>> sqlContext.createDataFrame(pandas.DataFrame([[1, 2]])).collect()  # doctest: +SKIP
  [Row(0=1, 1=2)]
  
  >>> sqlContext.createDataFrame(rdd, "a: string, b: int").collect()
  [Row(a='Alice', b=1)]
  >>> rdd = rdd.map(lambda row: row[1])
  >>> sqlContext.createDataFrame(rdd, "int").collect()
  [Row(value=1)]
  >>> sqlContext.createDataFrame(rdd, "boolean").collect() # doctest: +IGNORE_EXCEPTION_DETAIL
  Traceback (most recent call last):
      ...
  Py4JJavaError: ...
code: def createDataFrame(  # type: ignore[misc]
      self,
      data: Union[RDD[Any], Iterable[Any], "PandasDataFrameLike"],
      schema: Optional[Union[AtomicType, StructType, str]] = None,
      samplingRatio: Optional[float] = None,
      verifySchema: bool = True,
  ) -> DataFrame:
      """
      Creates a :class:`DataFrame` from an :class:`RDD`, a list or a :class:`pandas.DataFrame`.
  
      When ``schema`` is a list of column names, the type of each column
      will be inferred from ``data``.
  
      When ``schema`` is ``None``, it will try to infer the schema (column names and types)
      from ``data``, which should be an RDD of :class:`Row`,
      or :class:`namedtuple`, or :class:`dict`.
  
      When ``schema`` is :class:`pyspark.sql.types.DataType` or a datatype string it must match
      the real data, or an exception will be thrown at runtime. If the given schema is not
      :class:`pyspark.sql.types.StructType`, it will be wrapped into a
      :class:`pyspark.sql.types.StructType` as its only field, and the field name will be "value",
      each record will also be wrapped into a tuple, which can be converted to row later.
  
      If schema inference is needed, ``samplingRatio`` is used to determine the ratio of
      rows used for schema inference. The first row will be used if ``samplingRatio`` is ``None``.
  
      .. versionadded:: 1.3.0
  
      .. versionchanged:: 2.0.0
         The ``schema`` parameter can be a :class:`pyspark.sql.types.DataType` or a
         datatype string after 2.0.
         If it's not a :class:`pyspark.sql.types.StructType`, it will be wrapped into a
         :class:`pyspark.sql.types.StructType` and each record will also be wrapped into a tuple.
  
      .. versionchanged:: 2.1.0
         Added verifySchema.
  
      Parameters
      ----------
      data : :class:`RDD` or iterable
          an RDD of any kind of SQL data representation (:class:`Row`,
          :class:`tuple`, ``int``, ``boolean``, etc.), or :class:`list`, or
          :class:`pandas.DataFrame`.
      schema : :class:`pyspark.sql.types.DataType`, str or list, optional
          a :class:`pyspark.sql.types.DataType` or a datatype string or a list of
          column names, default is None.  The data type string format equals to
          :class:`pyspark.sql.types.DataType.simpleString`, except that top level struct type can
          omit the ``struct<>``.
      samplingRatio : float, optional
          the sample ratio of rows used for inferring
      verifySchema : bool, optional
          verify data types of every row against schema. Enabled by default.
  
      Returns
      -------
      :class:`DataFrame`
  
      Examples
      --------
      >>> l = [('Alice', 1)]
      >>> sqlContext.createDataFrame(l).collect()
      [Row(_1='Alice', _2=1)]
      >>> sqlContext.createDataFrame(l, ['name', 'age']).collect()
      [Row(name='Alice', age=1)]
  
      >>> d = [{'name': 'Alice', 'age': 1}]
      >>> sqlContext.createDataFrame(d).collect()
      [Row(age=1, name='Alice')]
  
      >>> rdd = sc.parallelize(l)
      >>> sqlContext.createDataFrame(rdd).collect()
      [Row(_1='Alice', _2=1)]
      >>> df = sqlContext.createDataFrame(rdd, ['name', 'age'])
      >>> df.collect()
      [Row(name='Alice', age=1)]
  
      >>> from pyspark.sql import Row
      >>> Person = Row('name', 'age')
      >>> person = rdd.map(lambda r: Person(*r))
      >>> df2 = sqlContext.createDataFrame(person)
      >>> df2.collect()
      [Row(name='Alice', age=1)]
  
      >>> from pyspark.sql.types import *
      >>> schema = StructType([
      ...    StructField("name", StringType(), True),
      ...    StructField("age", IntegerType(), True)])
      >>> df3 = sqlContext.createDataFrame(rdd, schema)
      >>> df3.collect()
      [Row(name='Alice', age=1)]
  
      >>> sqlContext.createDataFrame(df.toPandas()).collect()  # doctest: +SKIP
      [Row(name='Alice', age=1)]
      >>> sqlContext.createDataFrame(pandas.DataFrame([[1, 2]])).collect()  # doctest: +SKIP
      [Row(0=1, 1=2)]
  
      >>> sqlContext.createDataFrame(rdd, "a: string, b: int").collect()
      [Row(a='Alice', b=1)]
      >>> rdd = rdd.map(lambda row: row[1])
      >>> sqlContext.createDataFrame(rdd, "int").collect()
      [Row(value=1)]
      >>> sqlContext.createDataFrame(rdd, "boolean").collect() # doctest: +IGNORE_EXCEPTION_DETAIL
      Traceback (most recent call last):
          ...
      Py4JJavaError: ...
      """
      return self.sparkSession.createDataFrame(  # type: ignore[call-overload]
          data, schema, samplingRatio, verifySchema
      )
  
imports: import sys
  import warnings
  from typing import Optional, Union, Callable, Any, Iterable, List, Tuple, overload, Type, ClassVar, TYPE_CHECKING, cast
  from py4j.java_gateway import JavaObject
  from pyspark import _NoValue
  from pyspark._globals import _NoValueType
  from pyspark.sql.session import _monkey_patch_RDD, SparkSession
  from pyspark.sql.dataframe import DataFrame
  from pyspark.sql.readwriter import DataFrameReader
  from pyspark.sql.streaming import DataStreamReader
  from pyspark.sql.udf import UDFRegistration
  from pyspark.sql.udtf import UDTFRegistration
  from pyspark.errors.exceptions.captured import install_exception_handler
  from pyspark.context import SparkContext
  from pyspark.rdd import RDD
  from pyspark.sql.types import AtomicType, DataType, StructType
  from pyspark.sql.streaming import StreamingQueryManager
label_desc: Use image node_id 18 for calling the SQLContext obj's underlying member method code with example usage: obj.createDataFrame(data, schema, samplingRatio, verifySchema) and returns: self