yuqi1129 commented on code in PR #15006:
URL: https://github.com/apache/gravitino/pull/15006#discussion_r4628023650
##########
spark-connector/spark-common/src/main/java/org/apache/gravitino/spark/connector/jdbc/GravitinoJdbcCatalog.java:
##########
@@ -108,6 +122,7 @@ protected TableCatalog createAndInitSparkCatalog(
*/
@Override
protected Table loadSparkTable(Identifier ident) {
+ verifyJdbcConnectionUnchanged();
Review Comment:
Fixed in c6094c6903. Retained JDBC tables revalidate at scan and write
builder creation and before index operations. The H2 regression reads a row
while settings match, then changes the URL and verifies the retained DataFrame
and write builder report the restart error. Removing the scan check made the
retained DataFrame regression fail. The JDBC guide and PR description explain
the boundary for already-built plans. Verified on Spark 3.5 and 4.0.
##########
spark-connector/spark-common/src/main/java/org/apache/gravitino/spark/connector/jdbc/GravitinoJdbcCatalog.java:
##########
@@ -108,6 +122,7 @@ protected TableCatalog createAndInitSparkCatalog(
*/
@Override
protected Table loadSparkTable(Identifier ident) {
+ verifyJdbcConnectionUnchanged();
Review Comment:
Fixed in c6094c6903. CREATE TABLE and ALTER TABLE validate before invoking
the Gravitino mutation API. The regression checks that both calls reject
already-stale settings and leave the remote table API untouched. Removing the
prechecks made the test report both remote mutations. Verified on Spark 3.5 and
4.0.
##########
spark-connector/spark-common/src/main/java/org/apache/gravitino/spark/connector/jdbc/GravitinoJdbcCatalog.java:
##########
@@ -124,6 +139,48 @@ protected Table loadSparkTable(Identifier ident) {
}
}
+ private void verifyJdbcConnectionUnchanged() {
+ Catalog currentCatalog = refreshGravitinoCatalog();
+ Map<String, String> currentOptions =
+ getPropertiesConverter()
+ .toSparkCatalogProperties(
+ new CaseInsensitiveStringMap(sparkCatalogOptions),
+ propsWithSecrets(currentCatalog));
+ applyJdbcCredential(currentCatalog, currentOptions);
Review Comment:
Fixed in c6094c6903. Initialization and refresh each fetch credentials once
and reuse the result for property enrichment and JDBC overrides. Successful
catalog loads now log at DEBUG. The call-count regression passed on Spark 3.5
and 4.0.
--
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]