Class PolarisRestCatalogIntegrationBase
java.lang.Object
org.apache.iceberg.catalog.CatalogTests<org.apache.iceberg.rest.RESTCatalog>
org.apache.polaris.service.it.test.PolarisRestCatalogIntegrationBase
- Direct Known Subclasses:
PolarisRestCatalogAdlsIntegrationTestBase,PolarisRestCatalogFileIntegrationTest,PolarisRestCatalogGcsIntegrationTestBase,PolarisRestCatalogS3IntegrationTestBase
@ExtendWith(PolarisIntegrationTestExtension.class)
public abstract class PolarisRestCatalogIntegrationBase
extends org.apache.iceberg.catalog.CatalogTests<org.apache.iceberg.rest.RESTCatalog>
Import the full core Iceberg catalog tests by hitting the REST service via the RESTCatalog
client.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.iceberg.catalog.CatalogTests
org.apache.iceberg.catalog.CatalogTests.CustomMetricsReporter -
Field Summary
FieldsFields inherited from class org.apache.iceberg.catalog.CatalogTests
FILE_A, FILE_B, FILE_C, NS, OTHER_SCHEMA, RENAMED_TABLE, REPLACE_SCHEMA, REPLACE_SPEC, REPLACE_WRITE_ORDER, SCHEMA, SPEC, TABLE, TABLE_SCHEMA, TABLE_SPEC, TABLE_WRITE_ORDER, TBL, WRITE_ORDER -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidbefore(org.junit.jupiter.api.TestInfo testInfo) protected org.apache.iceberg.rest.RESTCatalogcatalog()voidcleanUp()protected voidcleanUp(PolarisClient client, String adminToken) Cleans up the Polaris environment after each test.Get the properties to be used for initializing theFileIOinstance used by test code for accessing test storage.protected voidcreatePolarisCatalog(org.apache.polaris.core.admin.model.Catalog catalog) Overridable methods to allow subclasses to execute additional logic on catalog creation.protected ClientPrincipalcreateTestPrincipal(PolarisClient client, String principalName, String principalRoleName) Creates a test principal with the specified name and role.voidprotected URIGet the base URI for the external catalog.protected abstract org.apache.polaris.core.admin.model.StorageConfigInfoGet the storage configuration information for the catalog.protected org.apache.iceberg.rest.RESTCataloginitCatalog(String catalogName, Map<String, String> additionalProperties) Initialize a RESTCatalog for testing.protected <T extends org.apache.iceberg.io.FileIO>
TinitializeClientFileIO(T fileIO) A hook for test subclasses to initializeFileIOobjects used by test cases themselves for accessing test storage.voidvoidprotected StringobtainToken(PolarisClient client, ClientPrincipal principal) Obtain an access token for the given principal credentials.protected booleanprotected booleanprotected booleanprotected booleanvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidRegister a table.voidCreate an EXTERNAL catalog.voidCreate an EXTERNAL catalog.voidvoidvoidCreate an EXTERNAL catalog.voidvoidvoidvoidvoidvoidvoidvoidInvoke an initial registerTable request to fetch and ensure ETag is present.voidvoidvoidvoidvoidvoidvoidvoidMethods inherited from class org.apache.iceberg.catalog.CatalogTests
assertFilePartitionSpec, assertFiles, assertFilesPartitionSpec, assertNoFiles, assertPreviousMetadataFileCount, assertUUIDsMatch, baseTableLocation, createAndDropEmptyNamespace, createTableTransaction, listNamespacesWithEmptyNamespace, listTablesInEmptyNamespace, namespacePropertiesOnEmptyNamespace, renameTableNamespaceMissing, replaceTableTransaction, supportsEmptyNamespace, supportsNamespaceProperties, supportsNamesWithDot, supportsNamesWithSlashes, tableCreationWithoutNamespace, testAppend, testBasicCreateTable, testBasicCreateTableThatAlreadyExists, testCatalogWithCustomMetricsReporter, testCompleteCreateOrReplaceTransactionCreate, testCompleteCreateOrReplaceTransactionReplace, testCompleteCreateTable, testCompleteCreateTransaction, testCompleteCreateTransactionMultipleSchemas, testCompleteCreateTransactionV2, testCompleteReplaceTransaction, testConcurrentAppendEmptyTable, testConcurrentAppendNonEmptyTable, testConcurrentCreateTransaction, testConcurrentReplaceTransactionPartitionSpec, testConcurrentReplaceTransactionPartitionSpec2, testConcurrentReplaceTransactionPartitionSpecConflict, testConcurrentReplaceTransactions, testConcurrentReplaceTransactionSchema, testConcurrentReplaceTransactionSchema2, testConcurrentReplaceTransactionSchemaConflict, testConcurrentReplaceTransactionSortOrder, testConcurrentReplaceTransactionSortOrderConflict, testCreateExistingNamespace, testCreateNamespace, testCreateNamespaceWithProperties, testCreateOrReplaceReplaceTransactionReplace, testCreateOrReplaceTransactionConcurrentCreate, testCreateOrReplaceTransactionCreate, testCreateTableWithDefaultColumnValue, testCreateTransaction, testDefaultTableProperties, testDefaultTablePropertiesCreateTransaction, testDefaultTablePropertiesReplaceTransaction, testDropMissingTable, testDropNamespace, testDropNonEmptyNamespace, testDropNonexistentNamespace, testDropTable, testDropTableWithoutPurge, testDropTableWithPurge, testListNamespaces, testListNestedNamespaces, testListNonExistingNamespace, testListTables, testLoadMetadataTable, testLoadMissingTable, testLoadNamespaceMetadata, testLoadTable, testLoadTableWithNonExistingNamespace, testMetadataFileLocationsRemovalAfterCommit, testNamespaceWithDot, testNamespaceWithSlash, testOverrideTableProperties, testOverrideTablePropertiesCreateTransaction, testOverrideTablePropertiesReplaceTransaction, testRegisterExistingTable, testRegisterTable, testRemoveNamespaceProperties, testRemoveNamespacePropertiesNamespaceDoesNotExist, testRemoveUnusedSchemas, testRemoveUnusedSpec, testRenameTable, testRenameTableDestinationTableAlreadyExists, testRenameTableMissingSourceTable, testReplaceTableKeepsSnapshotLog, testReplaceTransaction, testReplaceTransactionRequiresTableExists, testSetNamespaceProperties, testSetNamespacePropertiesNamespaceDoesNotExist, testTableNameWithDot, testTableNameWithSlash, testUpdateAndSetNamespaceProperties, testUpdateNamespaceProperties, testUpdateTableAssignmentSpecConflict, testUpdateTableOrderThenRevert, testUpdateTableSchema, testUpdateTableSchemaAssignmentConflict, testUpdateTableSchemaConflict, testUpdateTableSchemaServerSideRetry, testUpdateTableSchemaThenRevert, testUpdateTableSortOrder, testUpdateTableSortOrderServerSideRetry, testUpdateTableSpec, testUpdateTableSpecConflict, testUpdateTableSpecServerSideRetry, testUpdateTableSpecThenRevert, testUpdateTransaction, testUUIDValidation
-
Field Details
-
VIEW_QUERY
- See Also:
-
-
Constructor Details
-
PolarisRestCatalogIntegrationBase
public PolarisRestCatalogIntegrationBase()
-
-
Method Details
-
getStorageConfigInfo
protected abstract org.apache.polaris.core.admin.model.StorageConfigInfo getStorageConfigInfo()Get the storage configuration information for the catalog.- Returns:
- StorageConfigInfo instance containing the storage configuration
-
initializeClientFileIO
protected <T extends org.apache.iceberg.io.FileIO> T initializeClientFileIO(T fileIO) A hook for test subclasses to initializeFileIOobjects used by test cases themselves for accessing test storage.Important: this FileIO instance is not tied to a REST Catalog; it is created by test code performing adhoc, direct access to the storage; thus, it may not be configured with the same properties as the ones used by
catalog()! -
clientFileIOProperties
Get the properties to be used for initializing theFileIOinstance used by test code for accessing test storage. -
externalCatalogBaseLocation
Get the base URI for the external catalog. -
before
@BeforeEach public void before(org.junit.jupiter.api.TestInfo testInfo) -
createTestPrincipal
protected ClientPrincipal createTestPrincipal(PolarisClient client, String principalName, String principalRoleName) Creates a test principal with the specified name and role. Subclasses can override this method to customize the principal creation process, e.g. when using federated principals. -
obtainToken
Obtain an access token for the given principal credentials.By default, this method uses the
PolarisClientto obtain the token from the Polaris internal OAuth2 token endpoint.Subclasses can override this method to customize the token acquisition process, e.g. when using external identity providers.
-
cleanUp
- Throws:
IOException
-
cleanUp
Cleans up the Polaris environment after each test.Subclasses can override this method to perform additional cleanup actions.
-
catalog
protected org.apache.iceberg.rest.RESTCatalog catalog()- Specified by:
catalogin classorg.apache.iceberg.catalog.CatalogTests<org.apache.iceberg.rest.RESTCatalog>
-
createPolarisCatalog
protected void createPolarisCatalog(org.apache.polaris.core.admin.model.Catalog catalog) Overridable methods to allow subclasses to execute additional logic on catalog creation. -
initCatalog
protected org.apache.iceberg.rest.RESTCatalog initCatalog(String catalogName, Map<String, String> additionalProperties) Initialize a RESTCatalog for testing.- Specified by:
initCatalogin classorg.apache.iceberg.catalog.CatalogTests<org.apache.iceberg.rest.RESTCatalog>- Parameters:
catalogName- this parameter is currently unused.additionalProperties- additional properties to apply on top of the default test settings- Returns:
- a configured instance of RESTCatalog
-
requiresNamespaceCreate
protected boolean requiresNamespaceCreate()- Overrides:
requiresNamespaceCreatein classorg.apache.iceberg.catalog.CatalogTests<org.apache.iceberg.rest.RESTCatalog>
-
supportsNestedNamespaces
protected boolean supportsNestedNamespaces()- Overrides:
supportsNestedNamespacesin classorg.apache.iceberg.catalog.CatalogTests<org.apache.iceberg.rest.RESTCatalog>
-
supportsServerSideRetry
protected boolean supportsServerSideRetry()- Overrides:
supportsServerSideRetryin classorg.apache.iceberg.catalog.CatalogTests<org.apache.iceberg.rest.RESTCatalog>
-
overridesRequestedLocation
protected boolean overridesRequestedLocation()- Overrides:
overridesRequestedLocationin classorg.apache.iceberg.catalog.CatalogTests<org.apache.iceberg.rest.RESTCatalog>
-
testListGrantsOnCatalogObjectsToCatalogRoles
@Test public void testListGrantsOnCatalogObjectsToCatalogRoles() -
testListGrantsAfterRename
@Test public void testListGrantsAfterRename() -
testCreateTableWithOverriddenBaseLocation
@Test public void testCreateTableWithOverriddenBaseLocation() -
testCreateTableWithOverriddenBaseLocationCannotOverlapSibling
@Test public void testCreateTableWithOverriddenBaseLocationCannotOverlapSibling() -
testCreateTableWithOverriddenBaseLocationMustResideInNsDirectory
@Test public void testCreateTableWithOverriddenBaseLocationMustResideInNsDirectory() -
testLoadTableWithAccessDelegationForExternalCatalogWithConfigDisabled
@Test public void testLoadTableWithAccessDelegationForExternalCatalogWithConfigDisabled()Create an EXTERNAL catalog. The test configuration, by default, disables access delegation for EXTERNAL catalogs, so register a table and try to load it with the REST client configured to try to fetch vended credentials. Expect a ForbiddenException. -
testLoadTableWithoutAccessDelegationForExternalCatalogWithConfigDisabled
@Test public void testLoadTableWithoutAccessDelegationForExternalCatalogWithConfigDisabled()Create an EXTERNAL catalog. The test configuration, by default, disables access delegation for EXTERNAL catalogs. Register a table and attempt to load it WITHOUT access delegation. This should succeed. -
testLoadTableWithAccessDelegationForExternalCatalogWithConfigEnabledForCatalog
@Test public void testLoadTableWithAccessDelegationForExternalCatalogWithConfigEnabledForCatalog()Create an EXTERNAL catalog. The test configuration, by default, disables access delegation for EXTERNAL catalogs. However, we setenable.credential.vendingtotruefor this catalog, enabling it. Register a table and attempt to load it WITH access delegation. This should succeed. -
testLoadTableTwiceWithETag
@Test public void testLoadTableTwiceWithETag()Register a table. Then, invoke an initial loadTable request to fetch and ensure ETag is present. Then, invoke a second loadTable to ensure that ETag is matched. -
testRegisterAndLoadTableWithReturnedETag
@Test public void testRegisterAndLoadTableWithReturnedETag()Invoke an initial registerTable request to fetch and ensure ETag is present. Then, invoke a second loadTable to ensure that ETag is matched. -
testCreateAndLoadTableWithReturnedEtag
@Test public void testCreateAndLoadTableWithReturnedEtag() -
testSendMetricsReport
@Test public void testSendMetricsReport() -
testSendNotificationInternalCatalog
@Test public void testSendNotificationInternalCatalog() -
diffAgainstSingleTable
@Test public void diffAgainstSingleTable() -
multipleDiffsAgainstMultipleTables
@Test public void multipleDiffsAgainstMultipleTables() -
multipleDiffsAgainstMultipleTablesLastFails
@Test public void multipleDiffsAgainstMultipleTablesLastFails() -
testMultipleConflictingCommitsToSingleTableInTransaction
@Test public void testMultipleConflictingCommitsToSingleTableInTransaction() -
testTableExistsStatus
@Test public void testTableExistsStatus() -
testDropTableStatus
@Test public void testDropTableStatus() -
testViewExistsStatus
@Test public void testViewExistsStatus() -
testDropViewStatus
@Test public void testDropViewStatus() -
testDropViewWithPurge
@Test public void testDropViewWithPurge() -
testRenameViewStatus
@Test public void testRenameViewStatus() -
testLoadCredentials
@Test public void testLoadCredentials() -
testCreateGenericTable
@Test public void testCreateGenericTable() -
testLoadGenericTable
@Test public void testLoadGenericTable() -
testListGenericTables
@Test public void testListGenericTables() -
testDropGenericTable
@Test public void testDropGenericTable() -
testGrantsOnGenericTable
@Test public void testGrantsOnGenericTable() -
testGrantsOnNonExistingGenericTable
@Test public void testGrantsOnNonExistingGenericTable() -
testDropNonExistingGenericTable
@Test public void testDropNonExistingGenericTable() -
testLoadTableWithSnapshots
@Test public void testLoadTableWithSnapshots() -
testLoadTableWithRefFiltering
@Test public void testLoadTableWithRefFiltering() -
testCreateGenericTableWithReservedProperty
@Test public void testCreateGenericTableWithReservedProperty() -
testCreateNamespaceWithReservedProperty
@Test public void testCreateNamespaceWithReservedProperty() -
testUpdateNamespaceWithReservedProperty
@Test public void testUpdateNamespaceWithReservedProperty() -
testRemoveReservedPropertyFromNamespace
@Test public void testRemoveReservedPropertyFromNamespace() -
testCreateTableWithReservedProperty
@Test public void testCreateTableWithReservedProperty() -
testUpdateTableWithReservedProperty
@Test public void testUpdateTableWithReservedProperty() -
testLoadTableWithNonMatchingIfNoneMatchHeader
@Test public void testLoadTableWithNonMatchingIfNoneMatchHeader() -
testLoadTableWithMultipleIfNoneMatchETags
@Test public void testLoadTableWithMultipleIfNoneMatchETags() -
testLoadTableWithWildcardIfNoneMatchReturns400
@Test public void testLoadTableWithWildcardIfNoneMatchReturns400() -
testLoadNonExistentTableWithIfNoneMatch
@Test public void testLoadNonExistentTableWithIfNoneMatch() -
testETagBehaviorForTableSchemaChanges
@Test public void testETagBehaviorForTableSchemaChanges() -
testETagBehaviorForTableDropAndRecreateIntegration
@Test public void testETagBehaviorForTableDropAndRecreateIntegration() -
testETagChangeAfterDMLOperations
@Test public void testETagChangeAfterDMLOperations() -
testPaginatedListNamespaces
@Test public void testPaginatedListNamespaces() -
testPaginatedListTables
@Test public void testPaginatedListTables() -
testNonPaginatedListTablesViewNamespaces
@Test public void testNonPaginatedListTablesViewNamespaces()
-