Class PolarisCatalogUtils

java.lang.Object
org.apache.polaris.spark.utils.PolarisCatalogUtils

public class PolarisCatalogUtils extends Object
  • Field Details

  • Constructor Details

    • PolarisCatalogUtils

      public PolarisCatalogUtils()
  • Method Details

    • useIceberg

      public static boolean useIceberg(String provider)
      Check whether the table provider is iceberg.
    • useDelta

      public static boolean useDelta(String provider)
      Check whether the table provider is delta.
    • isTableWithSparkManagedLocation

      public static boolean isTableWithSparkManagedLocation(Map<String,String> properties)
      For tables whose location is manged by Spark Session Catalog, there will be no location or path in the properties.
    • loadSparkTable

      public static org.apache.spark.sql.connector.catalog.Table loadSparkTable(GenericTable genericTable)
      Load spark table using DataSourceV2.
      Returns:
      V2Table if DataSourceV2 is available for the table format. For delta table, it returns DeltaTableV2.
    • getAuthSession

      public static org.apache.iceberg.rest.auth.OAuth2Util.AuthSession getAuthSession(org.apache.iceberg.spark.SparkCatalog sparkCatalog)
      Get the catalogAuth field inside the RESTSessionCatalog used by Iceberg Spark Catalog use reflection. TODO: Deprecate this function once the iceberg client is updated to 1.9.0 to use AuthManager and the capability of injecting an AuthManger is available. Related iceberg PR: https://github.com/apache/iceberg/pull/12655