liviazhu commented on code in PR #52375:
URL: https://github.com/apache/spark/pull/52375#discussion_r2360523294
##########
sql/catalyst/src/main/scala/org/apache/spark/sql/internal/SQLConf.scala:
##########
@@ -6322,6 +6322,14 @@ object SQLConf {
.booleanConf
.createWithDefault(true)
+ val STREAMING_PROJECT_METADATA_COLS_ENABLED =
Review Comment:
Done.
##########
sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/FileMetadataStructSuite.scala:
##########
@@ -1133,4 +1133,98 @@ class FileMetadataStructSuite extends QueryTest with
SharedSparkSession {
assert(selectSingleRowDf.count() === 1)
}
}
+
+ Seq("true", "false").foreach { sideCharPadding =>
+ test(s"SPARK-53625: file metadata in streaming with char type, " +
+ s"sideCharPadding=$sideCharPadding") {
+ withSQLConf(SQLConf.READ_SIDE_CHAR_PADDING.key -> sideCharPadding) {
+ withTempDir { dir =>
+ import scala.jdk.CollectionConverters._
+
+ val metadata = new MetadataBuilder()
+ .putString("__CHAR_VARCHAR_TYPE_STRING", "char(1)")
+ .build()
+ val charSchemaStruct = new StructType()
+ .add(StructField("char_col", StringType, metadata = metadata))
+
+ val data: Seq[Row] = Seq(Row("A"), Row("B"))
Review Comment:
Removed
--
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]