This is an automated email from the ASF dual-hosted git repository.

danny0405 pushed a commit to branch release-0.10.0
in repository https://gitbox.apache.org/repos/asf/hudi.git

commit 1bf13d1a0f15e64433f915b32066caa8b7d76174
Author: Yann Byron <[email protected]>
AuthorDate: Fri Dec 3 16:37:13 2021 +0800

    [MINOR] use catalog schema if can not find table schema (#4182)
    
    (cherry picked from commit ca427240c026bc6ba6e19b9b8b0a069a6330147a)
---
 .../org/apache/spark/sql/catalyst/catalog/HoodieCatalogTable.scala      | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git 
a/hudi-spark-datasource/hudi-spark/src/main/scala/org/apache/spark/sql/catalyst/catalog/HoodieCatalogTable.scala
 
b/hudi-spark-datasource/hudi-spark/src/main/scala/org/apache/spark/sql/catalyst/catalog/HoodieCatalogTable.scala
index 7808122..fdf1b06 100644
--- 
a/hudi-spark-datasource/hudi-spark/src/main/scala/org/apache/spark/sql/catalyst/catalog/HoodieCatalogTable.scala
+++ 
b/hudi-spark-datasource/hudi-spark/src/main/scala/org/apache/spark/sql/catalyst/catalog/HoodieCatalogTable.scala
@@ -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)))
   }
 

Reply via email to