diff --git a/python/pyspark/sql/dataframe.py b/python/pyspark/sql/dataframe.py index 8f88545443c75c0452972ab76886de5d31206446..88ac4134a0d0d9b719ff29fdb8372f072605f37e 100644 --- a/python/pyspark/sql/dataframe.py +++ b/python/pyspark/sql/dataframe.py @@ -46,9 +46,9 @@ class DataFrame(object): """A distributed collection of data grouped into named columns. A :class:`DataFrame` is equivalent to a relational table in Spark SQL, - and can be created using various functions in :class:`SQLContext`:: + and can be created using various functions in :class:`SparkSession`:: - people = sqlContext.read.parquet("...") + people = spark.read.parquet("...") Once created, it can be manipulated using the various domain-specific-language (DSL) functions defined in: :class:`DataFrame`, :class:`Column`. @@ -59,9 +59,9 @@ class DataFrame(object): A more concrete example:: - # To create DataFrame using SQLContext - people = sqlContext.read.parquet("...") - department = sqlContext.read.parquet("...") + # To create DataFrame using SparkSession + people = spark.read.parquet("...") + department = spark.read.parquet("...") people.filter(people.age > 30).join(department, people.deptId == department.id) \\ .groupBy(department.name, "gender").agg({"salary": "avg", "age": "max"}) @@ -116,9 +116,9 @@ class DataFrame(object): @since(1.3) def registerTempTable(self, name): - """Registers this RDD as a temporary table using the given name. + """Registers this DataFrame as a temporary table using the given name. - The lifetime of this temporary table is tied to the :class:`SQLContext` + The lifetime of this temporary table is tied to the :class:`SparkSession` that was used to create this :class:`DataFrame`. >>> df.registerTempTable("people") diff --git a/sql/core/src/main/scala/org/apache/spark/sql/Dataset.scala b/sql/core/src/main/scala/org/apache/spark/sql/Dataset.scala index 6db6aa361e4cc44210fa317da8fade86861b5463..ab0c4126bcbddffa83d4353a437f2811b3083e7d 100644 --- a/sql/core/src/main/scala/org/apache/spark/sql/Dataset.scala +++ b/sql/core/src/main/scala/org/apache/spark/sql/Dataset.scala @@ -2891,8 +2891,8 @@ class Dataset[T] private[sql]( * * Global temporary view is cross-session. Its lifetime is the lifetime of the Spark application, * i.e. it will be automatically dropped when the application terminates. It's tied to a system - * preserved database `_global_temp`, and we must use the qualified name to refer a global temp - * view, e.g. `SELECT * FROM _global_temp.view1`. + * preserved database `global_temp`, and we must use the qualified name to refer a global temp + * view, e.g. `SELECT * FROM global_temp.view1`. * * @group basic * @since 2.2.0