srielau commented on code in PR #58541:
URL: https://github.com/apache/spark/pull/58541#discussion_r3939573893


##########
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/jdbc/JdbcUtils.scala:
##########
@@ -213,7 +213,8 @@ object JdbcUtils extends Logging with SQLConfHelper {
     case java.sql.Types.BIT => BooleanType // @see JdbcDialect for quirks
     case java.sql.Types.BLOB => BinaryType
     case java.sql.Types.BOOLEAN => BooleanType
-    case java.sql.Types.CHAR if conf.charVarcharAsString => StringType
+    case java.sql.Types.CHAR
+        if conf.charVarcharAsString && !conf.charVarcharStandardSemantics => 
StringType

Review Comment:
   Should this test `!conf.charVarcharFirstClassTypes` instead? 
`preserveCharVarcharTypeInfo` is also a first-class mode. With preserve=true 
and charVarcharAsString=true, this branch currently degrades JDBC CHAR/VARCHAR 
to STRING, contrary to the shared first-class-type contract. The VARCHAR branch 
below has the same issue. Could we also extend the precedence test to cover 
this combination?



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