Skip to content

Commit

Permalink
fix catalog
Browse files Browse the repository at this point in the history
  • Loading branch information
dchvn committed Dec 2, 2021
1 parent d9fa8a6 commit 729cc22
Showing 1 changed file with 3 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -323,11 +323,8 @@ final class DataFrameWriter[T] private[sql](ds: Dataset[T]) {
provider match {
case supportsExtract: SupportsCatalogOptions =>
val ident = supportsExtract.extractIdentifier(dsOptions)
val catalog = if (ident.namespace().isEmpty) {
Array(dsOptions.get("catalog"))
} else {
ident.namespace()
}
val catalog = CatalogV2Util.getTableProviderCatalog(
supportsExtract, catalogManager, dsOptions)

val location = Option(dsOptions.get("path")).map(TableCatalog.PROP_LOCATION -> _)
val tableSpec = TableSpec(
Expand All @@ -342,7 +339,7 @@ final class DataFrameWriter[T] private[sql](ds: Dataset[T]) {
runCommand(df.sparkSession) {
CreateTableAsSelect(
UnresolvedDBObjectName(
catalog.toSeq :+ ident.name,
catalog.name :: ident.name :: Nil,
isNamespace = false
),
partitioningAsV2,
Expand Down

0 comments on commit 729cc22

Please sign in to comment.