Peng-Lei commented on a change in pull request #35204:
URL: https://github.com/apache/spark/pull/35204#discussion_r784509866
##########
File path:
sql/catalyst/src/main/scala/org/apache/spark/sql/connector/catalog/V1Table.scala
##########
@@ -58,7 +59,7 @@ private[sql] case class V1Table(v1Table: CatalogTable)
extends Table {
override lazy val properties: util.Map[String, String] =
addV2TableProperties(v1Table).asJava
- override lazy val schema: StructType = v1Table.schema
+ override lazy val schema: StructType =
CharVarcharUtils.getRawSchema(v1Table.schema, SQLConf.get)
Review comment:
when v2 command work with v1 table. when we resolve the table. we load
the table by V2SessionCatalog, then create
`V1Table(sessionCatalog.getTableMetadata)`, here when `getTableMetadata`, we
will replace char/varchar with string in schema. So `V1Table(t)` t is alway
with string type although type is char/varchar. So re-construct the schema of
V1Table.
--
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]