@ignore_unicode_prefix
@since(2.0)
def sql(self, sqlQuery):
    'Returns a :class:`DataFrame` representing the result of the given query.\n\n        :return: :class:`DataFrame`\n\n        >>> df.createOrReplaceTempView("table1")\n        >>> df2 = spark.sql("SELECT field1 AS f1, field2 as f2 from table1")\n        >>> df2.collect()\n        [Row(f1=1, f2=u\'row1\'), Row(f1=2, f2=u\'row2\'), Row(f1=3, f2=u\'row3\')]\n        '
    return DataFrame(self._jsparkSession.sql(sqlQuery), self._wrapped)
Returns a :class:`DataFrame` representing the result of the given query.

:return: :class:`DataFrame`

>>> df.createOrReplaceTempView("table1")
>>> df2 = spark.sql("SELECT field1 AS f1, field2 as f2 from table1")
>>> df2.collect()
[Row(f1=1, f2=u'row1'), Row(f1=2, f2=u'row2'), Row(f1=3, f2=u'row3')]
@ignore_unicode_prefix
@since(2.0)
def sql(self, sqlQuery):
    'Returns a :class:`DataFrame` representing the result of the given query.\n\n        :return: :class:`DataFrame`\n\n        >>> df.createOrReplaceTempView("table1")\n        >>> df2 = spark.sql("SELECT field1 AS f1, field2 as f2 from table1")\n        >>> df2.collect()\n        [Row(f1=1, f2=u\'row1\'), Row(f1=2, f2=u\'row2\'), Row(f1=3, f2=u\'row3\')]\n        '
    return DataFrame(self._jsparkSession.sql(sqlQuery), self._wrapped)