def _test():
    import os
    import doctest
    from pyspark.context import SparkContext
    from pyspark.sql import Row
    import pyspark.sql.session
    os.chdir(os.environ['SPARK_HOME'])
    globs = pyspark.sql.session.__dict__.copy()
    sc = SparkContext('local[4]', 'PythonTest')
    globs['sc'] = sc
    globs['spark'] = SparkSession(sc)
    globs['rdd'] = rdd = sc.parallelize([Row(field1=1, field2='row1'), Row(field1=2, field2='row2'), Row(field1=3, field2='row3')])
    globs['df'] = rdd.toDF()
    (failure_count, test_count) = doctest.testmod(pyspark.sql.session, globs=globs, optionflags=(doctest.ELLIPSIS | doctest.NORMALIZE_WHITESPACE))
    globs['sc'].stop()
    if failure_count:
        exit((- 1))
def _test():
    import os
    import doctest
    from pyspark.context import SparkContext
    from pyspark.sql import Row
    import pyspark.sql.session
    os.chdir(os.environ['SPARK_HOME'])
    globs = pyspark.sql.session.__dict__.copy()
    sc = SparkContext('local[4]', 'PythonTest')
    globs['sc'] = sc
    globs['spark'] = SparkSession(sc)
    globs['rdd'] = rdd = sc.parallelize([Row(field1=1, field2='row1'), Row(field1=2, field2='row2'), Row(field1=3, field2='row3')])
    globs['df'] = rdd.toDF()
    (failure_count, test_count) = doctest.testmod(pyspark.sql.session, globs=globs, optionflags=(doctest.ELLIPSIS | doctest.NORMALIZE_WHITESPACE))
    globs['sc'].stop()
    if failure_count:
        exit((- 1))