1
0

[MINOR] use catalog schema if can not find table schema (#4182)

This commit is contained in:
Yann Byron
2021-12-03 16:37:13 +08:00
committed by GitHub
parent 0699521f83
commit ca427240c0

View File

@@ -117,7 +117,7 @@ class HoodieCatalogTable(val spark: SparkSession, val table: CatalogTable) exten
* Make StructField nullable.
*/
lazy val tableSchema: StructType = {
val originSchema = getTableSqlSchema(metaClient, includeMetadataFields = true).get
val originSchema = getTableSqlSchema(metaClient, includeMetadataFields = true).getOrElse(table.schema)
StructType(originSchema.map(_.copy(nullable = true)))
}