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

    https://github.com/apache/spark/pull/11724#discussion_r56266566
  
    --- Diff: 
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/csv/CSVInferSchema.scala
 ---
    @@ -86,6 +86,7 @@ private[csv] object CSVInferSchema {
             case IntegerType => tryParseInteger(field)
             case LongType => tryParseLong(field)
             case DoubleType => tryParseDouble(field)
    +        case _: DecimalType => tryParseDecimal(field)
    --- End diff --
    
    I added the `_` because `DecimalType` looks referencing the companion 
object. I tried that expression before but this emits the compilation error 
below.
    
    ```
    Error:(89, 14) pattern type is incompatible with expected type;
     found   : org.apache.spark.sql.types.DecimalType.type
     required: org.apache.spark.sql.types.DataType
    Note: if you intended to match against the class, try `case 
DecimalType(_,_)`
            case DecimalType => tryParseDecimal(field)
                 ^
    ```


---
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