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

    https://github.com/apache/spark/pull/15751#discussion_r86504643
  
    --- Diff: 
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/csv/CSVFileFormat.scala
 ---
    @@ -223,15 +232,15 @@ class CSVFileFormat extends TextBasedFileFormat with 
DataSourceRegister {
     
       private def verifySchema(schema: StructType): Unit = {
         def verifyType(dataType: DataType): Unit = dataType match {
    -        case ByteType | ShortType | IntegerType | LongType | FloatType |
    -             DoubleType | BooleanType | _: DecimalType | TimestampType |
    -             DateType | StringType =>
    +      case ByteType | ShortType | IntegerType | LongType | FloatType |
    +           DoubleType | BooleanType | _: DecimalType | TimestampType |
    +           DateType | StringType =>
     
    -        case udt: UserDefinedType[_] => verifyType(udt.sqlType)
    +      case udt: UserDefinedType[_] => verifyType(udt.sqlType)
     
    -        case _ =>
    -          throw new UnsupportedOperationException(
    -            s"CSV data source does not support ${dataType.simpleString} 
data type.")
    +      case _ =>
    +        throw new UnsupportedOperationException(
    +          s"CSV data source does not support ${dataType.simpleString} data 
type.")
    --- End diff --
    
    CSV currently throws `UnsupportedOperation` but text datasource throws 
`AnalysisException`. I just matched this to `UnsupportedOperation`. I am happy 
to match this to `AnalysisException` if anyone thinks so.


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