Github user clockfly commented on a diff in the pull request:

    https://github.com/apache/spark/pull/12945#discussion_r62618388
  
    --- Diff: sql/core/src/main/scala/org/apache/spark/sql/Dataset.scala ---
    @@ -2306,8 +2306,37 @@ class Dataset[T] private[sql](
        * @group basic
        * @since 1.6.0
        */
    +  @deprecated("Use createTempView(tableName, replaceIfExists = true) 
instead.", "2.0.0")
       def registerTempTable(tableName: String): Unit = {
    -    sparkSession.registerTable(toDF(), tableName)
    +    createTempView(tableName, replaceIfExists = true)
    +  }
    +
    +  /**
    +   * Creates a temporary view using the given name. The lifetime of this
    +   * temporary view is tied to the [[SQLContext]] that was used to create 
this Dataset.
    +   *
    +   * @throws AnalysisException if the view name already exists
    +   *
    +   * @group basic
    +   * @since 2.0.0
    +   */
    +  @throws[AnalysisException]
    +  def createTempView(viewName: String): Unit = {
    +    createTempView(viewName, replaceIfExists = false)
    +  }
    +
    +  /**
    +   * Creates a temporary view using the given name. The lifetime of this
    +   * temporary view is tied to the [[SQLContext]] that was used to create 
this Dataset.
    +   *
    +   * @throws AnalysisException if replaceIfExists flag is false and the 
view name already exists.
    +   *
    +   * @group basic
    +   * @since 2.0.0
    +   */
    +  @throws[AnalysisException]
    +  def createTempView(viewName: String, replaceIfExists: Boolean): Unit = {
    --- End diff --
    
    OK, will update the code.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to