Skip to content

Commit

Permalink
update format
Browse files Browse the repository at this point in the history
Signed-off-by: Peng Huo <[email protected]>
  • Loading branch information
penghuo committed May 15, 2024
1 parent e306a18 commit 5ba67b5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -147,24 +147,22 @@ package object flint {
def resolveCatalogName(spark: SparkSession, catalog: CatalogPlugin): String = {

/**
* Flint use FlintDelegatingSessionCatalog to customized catalog name.
* FlintDelegatingSessionCatalog name is spark_catalog which can not change. @see <a
* href="https://github.com/opensearch-project/opensearch-spark/issues/319#issuecomment2099515920">issue319</a>
* Check if the provided catalog is a session catalog.
*/
if (CatalogV2Util.isSessionCatalog(catalog)) {
val defaultCatalog = spark.conf.get(DEFAULT_CATALOG)
// defaultCatalog name is as same as customized catalog name.
if (spark.sessionState.catalogManager.isCatalogRegistered(defaultCatalog)) {
defaultCatalog
} else {

/**
* It may happen when spark.sql.defaultCatalog is configured, but there's no implementation.
* For instance, spark.sql.defaultCatalog = "unknown"
* It may happen when spark.sql.defaultCatalog is configured, but there's no
* implementation. For instance, spark.sql.defaultCatalog = "unknown"
*/
throw new RuntimeException("Unknown catalog name")
throw new IllegalStateException(s"Unknown catalog name: $defaultCatalog")
}
} else {
// Works for customized non Spark V2SessionCatalog implementation.
// Return the name for non-session catalogs
catalog.name()
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,7 @@ class FlintSparkSkippingIndexSqlITSuite extends FlintSparkSuite {
flint.describeIndex(s"flint_${catalogName}_sample_test1_skipping_index") shouldBe defined
flint.describeIndex(s"flint_${catalogName}_sample_test2_skipping_index") shouldBe defined
} finally {

/**
* TODO: REMOVE DROP TABLE when iceberg support CASCADE. More reading at
* https://github.com/apache/iceberg/pull/7275.
Expand Down

0 comments on commit 5ba67b5

Please sign in to comment.