@ignore_unicode_prefix
def __init__(self, sparkContext, jsparkSession=None):
    'Creates a new SparkSession.\n\n        >>> from datetime import datetime\n        >>> spark = SparkSession(sc)\n        >>> allTypes = sc.parallelize([Row(i=1, s="string", d=1.0, l=1,\n        ...     b=True, list=[1, 2, 3], dict={"s": 0}, row=Row(a=1),\n        ...     time=datetime(2014, 8, 1, 14, 1, 5))])\n        >>> df = allTypes.toDF()\n        >>> df.createOrReplaceTempView("allTypes")\n        >>> spark.sql(\'select i+1, d+1, not b, list[1], dict["s"], time, row.a \'\n        ...            \'from allTypes where b and i > 0\').collect()\n        [Row((i + CAST(1 AS BIGINT))=2, (d + CAST(1 AS DOUBLE))=2.0, (NOT b)=False, list[1]=2,             dict[s]=0, time=datetime.datetime(2014, 8, 1, 14, 1, 5), a=1)]\n        >>> df.rdd.map(lambda x: (x.i, x.s, x.d, x.l, x.b, x.time, x.row.a, x.list)).collect()\n        [(1, u\'string\', 1.0, 1, True, datetime.datetime(2014, 8, 1, 14, 1, 5), 1, [1, 2, 3])]\n        '
    from pyspark.sql.context import SQLContext
    self._sc = sparkContext
    self._jsc = self._sc._jsc
    self._jvm = self._sc._jvm
    if (jsparkSession is None):
        jsparkSession = self._jvm.SparkSession(self._jsc.sc())
    self._jsparkSession = jsparkSession
    self._jwrapped = self._jsparkSession.sqlContext()
    self._wrapped = SQLContext(self._sc, self, self._jwrapped)
    _monkey_patch_RDD(self)
    install_exception_handler()
    if ((SparkSession._instantiatedSession is None) or (SparkSession._instantiatedSession._sc._jsc is None)):
        SparkSession._instantiatedSession = self
Creates a new SparkSession.

>>> from datetime import datetime
>>> spark = SparkSession(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")
>>> spark.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 + CAST(1 AS BIGINT))=2, (d + CAST(1 AS DOUBLE))=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, u'string', 1.0, 1, True, datetime.datetime(2014, 8, 1, 14, 1, 5), 1, [1, 2, 3])]
@ignore_unicode_prefix
def __init__(self, sparkContext, jsparkSession=None):
    'Creates a new SparkSession.\n\n        >>> from datetime import datetime\n        >>> spark = SparkSession(sc)\n        >>> allTypes = sc.parallelize([Row(i=1, s="string", d=1.0, l=1,\n        ...     b=True, list=[1, 2, 3], dict={"s": 0}, row=Row(a=1),\n        ...     time=datetime(2014, 8, 1, 14, 1, 5))])\n        >>> df = allTypes.toDF()\n        >>> df.createOrReplaceTempView("allTypes")\n        >>> spark.sql(\'select i+1, d+1, not b, list[1], dict["s"], time, row.a \'\n        ...            \'from allTypes where b and i > 0\').collect()\n        [Row((i + CAST(1 AS BIGINT))=2, (d + CAST(1 AS DOUBLE))=2.0, (NOT b)=False, list[1]=2,             dict[s]=0, time=datetime.datetime(2014, 8, 1, 14, 1, 5), a=1)]\n        >>> df.rdd.map(lambda x: (x.i, x.s, x.d, x.l, x.b, x.time, x.row.a, x.list)).collect()\n        [(1, u\'string\', 1.0, 1, True, datetime.datetime(2014, 8, 1, 14, 1, 5), 1, [1, 2, 3])]\n        '
    from pyspark.sql.context import SQLContext
    self._sc = sparkContext
    self._jsc = self._sc._jsc
    self._jvm = self._sc._jvm
    if (jsparkSession is None):
        jsparkSession = self._jvm.SparkSession(self._jsc.sc())
    self._jsparkSession = jsparkSession
    self._jwrapped = self._jsparkSession.sqlContext()
    self._wrapped = SQLContext(self._sc, self, self._jwrapped)
    _monkey_patch_RDD(self)
    install_exception_handler()
    if ((SparkSession._instantiatedSession is None) or (SparkSession._instantiatedSession._sc._jsc is None)):
        SparkSession._instantiatedSession = self