zabetak commented on code in PR #5919:
URL: https://github.com/apache/hive/pull/5919#discussion_r2206860154


##########
itests/util/src/main/java/org/apache/hadoop/hive/ql/qoption/QTestDatabaseHandler.java:
##########
@@ -82,52 +80,48 @@ AbstractExternalDB create() {
     abstract AbstractExternalDB create();
   }
 
-  private final Map<DatabaseType, String> databaseToScript = new 
EnumMap<>(DatabaseType.class);
+  private final String scriptsDir;
+  private final List<AbstractExternalDB> databases = new ArrayList<>();

Review Comment:
   Allowing the creation of multiple databases of the same type (e.g., mysql) 
is fine and would allow to simulate real customer use-cases. 
   
   Defining the same database mysql multiple times won't work directly after 
this patch gets in but my intention is to make this happen by migrating 
`AbstractExternalDB` hierarchy to use 
[testcontainers](https://testcontainers.com/) (similar to HIVE-24419).
   
   In addition, we already have some tests that use multiple derby databases 
and I would like to migrate them to use the qt:database framework (HIVE-29031) 
but I am waiting for this and few other tickets to go in first.
   
   What is definitely not possible is to have the same database name defined 
multiple times. The following is invalid since it would be impossible to use 
the `System` property convention adopted here.
   ```
   --!qt:database:mysql:qdb1:q_test_country_state_city_tables.sql
   --!qt:database:postgres:qdb1:q_test_country_state_city_tables.sql
   ```
   
   All in all if we really want to make the DB definition mechanism fully 
bullet-proof we would have to do two checks:
   * Ensure DB name is unique
   * Ensure DB type is unique (this limitation will be removed once we migrate 
to testcontainers library)
   
   Assuming that we want to enforce both then the `List` data structure stills 
makes sense.
   
   Do you want that I push a new commit to implement the aforementioned checks?



-- 
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: gitbox-unsubscr...@hive.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscr...@hive.apache.org
For additional commands, e-mail: gitbox-h...@hive.apache.org

Reply via email to