From 64fde374eb93809e87b1dcd4b471b53f8e26f80f Mon Sep 17 00:00:00 2001 From: fuqijun Date: Wed, 3 Aug 2022 16:34:12 +0800 Subject: [PATCH] [HUDI-4183] Fix using HoodieCatalog to create non-hudi tables (#5743) --- .../org/apache/spark/sql/hudi/catalog/HoodieCatalog.scala | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/hudi-spark-datasource/hudi-spark3/src/main/scala/org/apache/spark/sql/hudi/catalog/HoodieCatalog.scala b/hudi-spark-datasource/hudi-spark3/src/main/scala/org/apache/spark/sql/hudi/catalog/HoodieCatalog.scala index 8cb2b1df6bb31..53a1a4c177eb7 100644 --- a/hudi-spark-datasource/hudi-spark3/src/main/scala/org/apache/spark/sql/hudi/catalog/HoodieCatalog.scala +++ b/hudi-spark-datasource/hudi-spark3/src/main/scala/org/apache/spark/sql/hudi/catalog/HoodieCatalog.scala @@ -109,7 +109,11 @@ class HoodieCatalog extends DelegatingCatalogExtension schema: StructType, partitions: Array[Transform], properties: util.Map[String, String]): Table = { - createHoodieTable(ident, schema, partitions, properties, Map.empty, Option.empty, TableCreationMode.CREATE) + if (sparkAdapter.isHoodieTable(properties)) { + createHoodieTable(ident, schema, partitions, properties, Map.empty, Option.empty, TableCreationMode.CREATE) + } else { + super.createTable(ident, schema, partitions, properties) + } } override def tableExists(ident: Identifier): Boolean = super.tableExists(ident)