nastra commented on code in PR #14465:
URL: https://github.com/apache/iceberg/pull/14465#discussion_r2563508563
##########
core/src/test/java/org/apache/iceberg/rest/TestRESTCatalog.java:
##########
@@ -3066,6 +3073,93 @@ public void testCommitStateUnknownNotReconciled() {
.satisfies(ex -> assertThat(((CommitStateUnknownException)
ex).getSuppressed()).isEmpty());
}
+ @Test
+ public void testCustomTableOperationsInjection() throws IOException {
+ AtomicBoolean customTableOpsCalled = new AtomicBoolean();
+
+ // Custom RESTSessionCatalog that overrides table operations creation
+ class CustomRESTSessionCatalog extends RESTSessionCatalog {
+ CustomRESTSessionCatalog(
+ Function<Map<String, String>, RESTClient> clientBuilder,
+ BiFunction<SessionCatalog.SessionContext, Map<String, String>,
FileIO> ioBuilder) {
+ super(clientBuilder, ioBuilder);
+ }
+
+ @Override
+ protected RESTTableOperations newTableOps(
+ RESTClient restClient,
+ String path,
+ Supplier<Map<String, String>> headers,
+ FileIO fileIO,
+ TableMetadata current,
+ Set<Endpoint> supportedEndpoints) {
+ customTableOpsCalled.set(true);
+ return super.newTableOps(restClient, path, headers, fileIO, current,
supportedEndpoints);
+ }
+
+ @Override
+ protected RESTTableOperations newTableOps(
+ RESTClient restClient,
+ String path,
+ Supplier<Map<String, String>> headers,
+ FileIO fileIO,
+ RESTTableOperations.UpdateType updateType,
+ List<MetadataUpdate> createChanges,
+ TableMetadata current,
+ Set<Endpoint> supportedEndpoints) {
+ customTableOpsCalled.set(true);
Review Comment:
maybe use two different variables like you had before to distinguish between
which one was actually called
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]