cloud-fan commented on code in PR #41993:
URL: https://github.com/apache/spark/pull/41993#discussion_r1266124561


##########
sql/core/src/test/scala/org/apache/spark/sql/CharVarcharTestSuite.scala:
##########
@@ -1167,4 +1172,31 @@ class DSV2CharVarcharTestSuite extends 
CharVarcharTestSuite
       }
     }
   }
+
+  test("SPARK-44414: Fixed matching check for CharType/VarcharType") {
+    Seq("{\"__CHAR_VARCHAR_TYPE_STRING\":\"varchar(80)\"}",
+      "{\"__CHAR_VARCHAR_TYPE_STRING\":\"char(80)\"}").foreach(json => {
+
+      // query
+      val rows = Seq(Row("1", "2"))
+      val metadata = new 
MetadataBuilder().withMetadata(Metadata.fromJson(json)).build()
+      val schema = StructType(Seq(
+        StructField("x", StringType, metadata = metadata),
+        StructField("y", StringType, metadata = metadata)))

Review Comment:
   I'm not really sure this is an end-to-end test... 
`__CHAR_VARCHAR_TYPE_STRING` is an internal metadata key and we don't expect 
end users to set it.



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

Reply via email to