akune commented on code in PR #14603:
URL: https://github.com/apache/iceberg/pull/14603#discussion_r2548700826
##########
core/src/main/java/org/apache/iceberg/jdbc/JdbcCatalog.java:
##########
@@ -264,6 +261,71 @@ private void updateSchemaIfRequired() {
}
}
+ private boolean isOracle(Connection conn) {
+ try {
+ String databaseProductName = conn.getMetaData().getDatabaseProductName();
+ return databaseProductName != null
+ && databaseProductName.toLowerCase(Locale.ROOT).contains("oracle");
+ } catch (SQLException e) {
+ throw new UncheckedSQLException(e, "Cannot determine database product
name");
+ }
+ }
+
+ private boolean tableExists(Connection conn, String tableNamePattern) throws
SQLException {
+ DatabaseMetaData dbMeta = conn.getMetaData();
+
+ String[] tableVariants =
+ new String[] {
+ tableNamePattern,
+ tableNamePattern == null ? null :
tableNamePattern.toUpperCase(Locale.ROOT),
+ tableNamePattern == null ? null :
tableNamePattern.toLowerCase(Locale.ROOT)
Review Comment:
I wanted this method to be as flexible as possible, but I agree this is -
again - overthinking it.
I adapted the method.
To retain some flexibility it now converts to both lower and upper cases and
ignores the original case.
--
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]