peter-toth commented on code in PR #52193: URL: https://github.com/apache/spark/pull/52193#discussion_r2315312910
########## sql/hive/src/main/scala/org/apache/spark/sql/hive/HiveMetastoreCatalog.scala: ########## @@ -338,14 +339,19 @@ private[hive] class HiveMetastoreCatalog(sparkSession: SparkSession) extends Log options: Map[String, String], fileFormat: FileFormat, fileIndexOpt: Option[FileIndex] = None): CatalogTable = { + val tableMeta = if (sparkSession.sessionState.conf.getConf(CONVERT_METASTORE_AS_NULLABLE)) { + relation.tableMeta.copy(schema = relation.tableMeta.schema.asNullable) + } else { + relation.tableMeta + } val inferenceMode = sparkSession.sessionState.conf.caseSensitiveInferenceMode - val shouldInfer = (inferenceMode != NEVER_INFER) && !relation.tableMeta.schemaPreservesCase - val tableName = relation.tableMeta.identifier.unquotedString + val shouldInfer = (inferenceMode != NEVER_INFER) && !tableMeta.schemaPreservesCase if (shouldInfer) { + val tableName = relation.tableMeta.identifier.unquotedString Review Comment: We can drop `relation.` here for code consistency. -- 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