1
0

[HUDI-4183] Fix using HoodieCatalog to create non-hudi tables (#5743)

This commit is contained in:
leesf
2022-06-03 17:16:48 +08:00
committed by GitHub
parent 51602a34f7
commit 3759a38b99
2 changed files with 38 additions and 3 deletions

View File

@@ -118,9 +118,13 @@ class HoodieCatalog extends DelegatingCatalogExtension
schema: StructType,
partitions: Array[Transform],
properties: util.Map[String, String]): Table = {
val locUriAndTableType = deduceTableLocationURIAndTableType(ident, properties)
createHoodieTable(ident, schema, locUriAndTableType, partitions, properties,
Map.empty, Option.empty, TableCreationMode.CREATE)
if (sparkAdapter.isHoodieTable(properties)) {
val locUriAndTableType = deduceTableLocationURIAndTableType(ident, properties)
createHoodieTable(ident, schema, locUriAndTableType, partitions, properties,
Map.empty, Option.empty, TableCreationMode.CREATE)
} else {
super.createTable(ident, schema, partitions, properties)
}
}
override def tableExists(ident: Identifier): Boolean = super.tableExists(ident)