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

    https://github.com/apache/spark/pull/19339#discussion_r140987769
  
    --- Diff: 
sql/core/src/main/scala/org/apache/spark/sql/DataFrameReader.scala ---
    @@ -456,6 +456,40 @@ class DataFrameReader private[sql](sparkSession: 
SparkSession) extends Logging {
       }
     
       /**
    +   * Loads a `JavaRDD[String]` storing storing CSV rows and returns the 
result as a `DataFrame`.
    +   *
    +   * If the schema is not specified using `schema` function and 
`inferSchema` option is enabled,
    +   * this function goes through the input once to determine the input 
schema.
    +   *
    +   * If the schema is not specified using `schema` function and 
`inferSchema` option is disabled,
    +   * it determines the columns as string types and it reads only the first 
line to determine the
    +   * names and the number of fields.
    +   *
    +   * @param csvRDD input RDD with one CSV row per record
    +   * @since 2.2.0
    +   */
    +  @deprecated("Use csv(Dataset[String]) instead.", "2.2.0")
    +  def csv(csvRDD: JavaRDD[String]): DataFrame = csv(csvRDD.rdd)
    +
    +  /**
    +   * Loads a `RDD[String]` storing storing CSV rows and returns the result 
as a `DataFrame`.
    +   *
    +   * If the schema is not specified using `schema` function and 
`inferSchema` option is enabled,
    +   * this function goes through the input once to determine the input 
schema.
    +   *
    +   * If the schema is not specified using `schema` function and 
`inferSchema` option is disabled,
    +   * it determines the columns as string types and it reads only the first 
line to determine the
    +   * names and the number of fields.
    +   *
    +   * @param csvRDD input RDD with one CSV row per record
    +   * @since 2.2.0
    +   */
    +  @deprecated("Use csv(Dataset[String]) instead.", "2.2.0")
    +  def csv(csvRDD: RDD[String]): DataFrame = {
    --- End diff --
    
    Yeah...It's weird to add a deprecated method. :) We either add a special 
wrapper for this purpose or doing this in python-side if possible and not 
complicated.


---

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

Reply via email to