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

    https://github.com/apache/spark/pull/12268#discussion_r61358445
  
    --- Diff: 
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/csv/InferSchema.scala
 ---
    @@ -30,22 +30,37 @@ import org.apache.spark.sql.catalyst.util.DateTimeUtils
     import org.apache.spark.sql.types._
     import org.apache.spark.unsafe.types.UTF8String
     
    -private[csv] object CSVInferSchema {
    +private[csv] object InferSchema {
     
       /**
        * Similar to the JSON schema inference
        *     1. Infer type of each row
        *     2. Merge row types to find common type
        *     3. Replace any null types with string type
        */
    -  def infer(
    -      tokenRdd: RDD[Array[String]],
    -      header: Array[String],
    -      nullValue: String = ""): StructType = {
    +  def infer(csv: RDD[String], options: CSVOptions): StructType = {
    --- End diff --
    
    Actually, it does call this class method in `DefaultSource.inferSchema`. I 
intentionally made the same structure with `JSONRelation`. JSON data source 
also have the class with the same name and same method in order to fix issues 
easily in the future together . (Actually, the main purpose for refactoring 
this is inconsistency of structures although they could almost identical 
structures).


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to