flyrain commented on code in PR #1371: URL: https://github.com/apache/polaris/pull/1371#discussion_r2060588883
########## quarkus/service/src/intTest/java/org/apache/polaris/service/quarkus/it/relational/jdbc/JdbcRestCatalogIT.java: ########## @@ -0,0 +1,28 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.polaris.service.quarkus.it.relational.jdbc; + +import io.quarkus.test.junit.QuarkusIntegrationTest; +import io.quarkus.test.junit.TestProfile; +import org.apache.polaris.service.it.test.PolarisRestCatalogIntegrationTest; +import org.apache.polaris.test.commons.RelationalJdbcProfile; + +@TestProfile(RelationalJdbcProfile.class) +@QuarkusIntegrationTest +public class JdbcRestCatalogIT extends PolarisRestCatalogIntegrationTest {} Review Comment: Not a blocker: Jdbc one is necessary. Do we need other two sets of integration tests for in-memory database? cc @dimas-b @adutra ########## extension/persistence/relational-jdbc/src/main/java/org/apache/polaris/extension/persistence/relational/jdbc/models/ModelEntity.java: ########## @@ -152,8 +152,8 @@ public ModelEntity fromResultSet(ResultSet r) throws SQLException { .purgeTimestamp(r.getObject("purge_timestamp", Long.class)) .toPurgeTimestamp(r.getObject("to_purge_timestamp", Long.class)) .lastUpdateTimestamp(r.getObject("last_update_timestamp", Long.class)) - .properties(r.getObject("properties", String.class)) - .internalProperties(r.getObject("internal_properties", String.class)) + .properties(r.getString("properties")) + .internalProperties(r.getString("internal_properties")) Review Comment: Nit: add a comment that String.class does't work with JSONB. ########## extension/persistence/relational-jdbc/src/main/java/org/apache/polaris/extension/persistence/relational/jdbc/JdbcBasePersistenceImpl.java: ########## @@ -112,13 +161,12 @@ public void writeEntity( originalEntity.getEntityVersion(), "realm_id", realmId); - query = generateUpdateQuery(modelEntity, params); try { - int rowsUpdated = datasourceOperations.executeUpdate(query); + int rowsUpdated = execute(executor, generateUpdateQuery(modelEntity, params)); if (rowsUpdated == 0) { throw new RetryOnConcurrencyException( "Entity '%s' id '%s' concurrently modified; expected version %s", - entity.getName(), entity.getId(), originalEntity.getEntityVersion()); + originalEntity.getName(), originalEntity.getId(), originalEntity.getEntityVersion()); } } catch (SQLException e) { Review Comment: Do we need to check the constraint violation here? ########## extension/persistence/relational-jdbc/src/main/java/org/apache/polaris/extension/persistence/relational/jdbc/JdbcMetaStoreManagerFactory.java: ########## @@ -106,12 +111,21 @@ private void initializeForRealm( } private DatasourceOperations getDatasourceOperations(boolean isBootstrap) { - DatasourceOperations databaseOperations = new DatasourceOperations(dataSource); + // TODO: remove when multiple dataSources are supported. + if (dataSources.size() > 1) { + throw new IllegalStateException("More than one dataSources configured"); + } Review Comment: Minor: -> `Precondition.checkState()` -- 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: issues-unsubscr...@polaris.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org