[MINOR] use catalog schema if can not find table schema (#4182)
This commit is contained in:
@@ -117,7 +117,7 @@ class HoodieCatalogTable(val spark: SparkSession, val table: CatalogTable) exten
|
|||||||
* Make StructField nullable.
|
* Make StructField nullable.
|
||||||
*/
|
*/
|
||||||
lazy val tableSchema: StructType = {
|
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)))
|
StructType(originSchema.map(_.copy(nullable = true)))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user