sunchao commented on a change in pull request #32777:
URL: https://github.com/apache/spark/pull/32777#discussion_r647780659



##########
File path: 
sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/parquet/ParquetIOSuite.scala
##########
@@ -496,6 +496,28 @@ class ParquetIOSuite extends QueryTest with ParquetTest 
with SharedSparkSession
     }
   }
 
+  test("SPARK-35640: read binary as timestamp should throw schema incompatible 
error") {
+    val data = (1 to 4).map(i => Tuple1(i.toString))
+    val readSchema = StructType(Seq(StructField("_1", 
DataTypes.TimestampType)))
+
+    withParquetFile(data) { path =>
+      val errMsg = 
intercept[Exception](spark.read.schema(readSchema).parquet(path).collect())
+          .getMessage
+      assert(errMsg.contains("Parquet column cannot be converted in file"))
+    }
+  }
+
+  test("SPARK-35640: int as long should throw schema incompatible error") {

Review comment:
       schema evolution from int to bigint is unsupported for Parquet atm - 
plan to address it in https://issues.apache.org/jira/browse/SPARK-35461




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]



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

Reply via email to