Package org.apache.polaris.spark.utils
Class PolarisCatalogUtils
java.lang.Object
org.apache.polaris.spark.utils.PolarisCatalogUtils
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic org.apache.iceberg.rest.auth.OAuth2Util.AuthSessiongetAuthSession(org.apache.iceberg.spark.SparkCatalog sparkCatalog) Get the catalogAuth field inside the RESTSessionCatalog used by Iceberg Spark Catalog use reflection.static booleanisTableWithSparkManagedLocation(Map<String, String> properties) For tables whose location is manged by Spark Session Catalog, there will be no location or path in the properties.static org.apache.spark.sql.connector.catalog.TableloadSparkTable(GenericTable genericTable) Load spark table using DataSourceV2.static booleanCheck whether the table provider is delta.static booleanuseIceberg(String provider) Check whether the table provider is iceberg.
-
Field Details
-
TABLE_PROVIDER_KEY
- See Also:
-
TABLE_PATH_KEY
- See Also:
-
-
Constructor Details
-
PolarisCatalogUtils
public PolarisCatalogUtils()
-
-
Method Details
-
useIceberg
Check whether the table provider is iceberg. -
useDelta
Check whether the table provider is delta. -
isTableWithSparkManagedLocation
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
-