wayneguow commented on code in PR #47506:
URL: https://github.com/apache/spark/pull/47506#discussion_r1716879942
##########
sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/csv/CSVSuite.scala:
##########
@@ -1765,6 +1765,32 @@ abstract class CSVSuite
}
}
+ test("SPARK-49016: Queries from raw CSV files are disallowed when the
referenced columns only" +
+ " include the internal corrupt record column") {
+ val schema = new StructType()
+ .add("a", IntegerType)
+ .add("b", DateType)
+ .add("_corrupt_record", StringType)
+
+ // negative cases
+ checkError(
+ exception = intercept[AnalysisException] {
+ spark.read.schema(schema).csv(testFile(valueMalformedFile))
+ .select("_corrupt_record").collect()
+ },
+ errorClass = "_LEGACY_ERROR_TEMP_1285",
Review Comment:
@MaxGekk Of course. And I plan to use
`UNSUPPORTED_FEATURE.QUERY_ONLY_INCLUDE_CORRUPT_RECORD_COLUMN` as the error
class name, do you think it's suitable?
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]