sunxiaoguang commented on code in PR #49453:
URL: https://github.com/apache/spark/pull/49453#discussion_r1959695029


##########
connector/docker-integration-tests/src/test/scala/org/apache/spark/sql/jdbc/v2/MySQLIntegrationSuite.scala:
##########
@@ -264,4 +342,10 @@ class MySQLOverMariaConnectorIntegrationSuite extends 
MySQLIntegrationSuite {
       
s"jdbc:mysql://$ip:$port/mysql?user=root&password=rootpass&allowPublicKeyRetrieval=true"
 +
         s"&useSSL=false"
   }
+
+  // MariaDB Connector/J uses collation 'utf8mb4_unicode_ci' as collation for 
connection.
+  // The MySQL server 9.1.0 uses collation 'utf8mb4_0900_ai_ci' for database 
by default.
+  // This method uses string literal so the result of cast and literal have 
the same collation.
+  override def testCastStringTarget(stringLiteral: String, stringCol: String): 
String =

Review Comment:
   The root cause is the MariaDB JDBC driver is not able to use the same 
default collation for connection. If we can accept changing the collation of 
connection to make it consistent with MySQL server, the test logic can be the 
same for both MySQL JDBC and MariaDB JDBC.
   
   I didn't want to change the default settings for all tests, but that's 
probably the only way to fix the inconsistency and use the same code in test. 
What do you think about this? 



-- 
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: reviews-unsubscr...@spark.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to