[ 
https://issues.apache.org/jira/browse/HIVE-25594?focusedWorklogId=669319&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-669319
 ]

ASF GitHub Bot logged work on HIVE-25594:
-----------------------------------------

                Author: ASF GitHub Bot
            Created on: 24/Oct/21 20:53
            Start Date: 24/Oct/21 20:53
    Worklog Time Spent: 10m 
      Work Description: zabetak opened a new pull request #2742:
URL: https://github.com/apache/hive/pull/2742


   ### What changes were proposed in this pull request?
   1. Refactor `AbstractExternalDB` and subclasses: (i) turn setters to 
getters; (ii) inline methods; (iii) reduce visibility when possible; (iv) drop 
redundant comments; (v) drop unnecessary logging and try/catch blocks.
   2. Use provided user/password/dbname when starting Postgres instead of 
default.
   3. Use correct driver and docker image for MySQL database.
   4. Support additional databases (MariaDB, Oracle, MSSQLServer) for tests.
   5. Introduce `QTestDatabaseHandler` class for handling completely setup, 
init and cleanup of dockerized DBMS.
   6. Drop `TestMiniLlapExtDBCliDriver`, with associated config, properties 
etc. 
   
   ### Why are the changes needed?
   It is now possible to:
   1. initialize a dockerized DBMS in any qtest without the need for specific 
CLI driver or configuration;
   2. use multiple DBMS of different types in the same qtest;
   3. use different initialization scripts per test/database;
   4. use additional databases (MariaDB, Oracle, MSSQLServer) in tests.
   
   Misc:
   5. Improve readability and encapsulation of `AbstractExternalDB` and friends.
   6. Small bugs in Postgres and MySQL.
   
   ### Does this PR introduce _any_ user-facing change?
   No, it only impacts developers.
   
   ### How was this patch tested?
   `mvn test -Dtest=TestMiniLlapLocalCliDriver -Dqfile_regex="qt_database.*" 
-Dtest.output.overwrite`


-- 
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


Issue Time Tracking
-------------------

            Worklog Id:     (was: 669319)
    Remaining Estimate: 0h
            Time Spent: 10m

> Setup JDBC databases in tests via QT options
> --------------------------------------------
>
>                 Key: HIVE-25594
>                 URL: https://issues.apache.org/jira/browse/HIVE-25594
>             Project: Hive
>          Issue Type: Improvement
>          Components: Testing Infrastructure
>            Reporter: Stamatis Zampetakis
>            Assignee: Stamatis Zampetakis
>            Priority: Major
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> The goal of this jira is to add a new QT option for setting up JDBC DBMS and 
> using it in qtests which need a JDBC endpoint up and running. It can be used 
> in tests with external JDBC tables, connectors, etc.
> A sample file using the proposed option ({{qt:database}}) is shown below.
> {code:sql}
> --!qt:database:postgres:init_sript_1234.sql:cleanup_script_1234.sql
> CREATE EXTERNAL TABLE country (name varchar(80))
> STORED BY 'org.apache.hive.storage.jdbc.JdbcStorageHandler'
> TBLPROPERTIES (
> "hive.sql.database.type" = "POSTGRES",
> "hive.sql.jdbc.driver" = "org.postgresql.Driver",
> "hive.sql.jdbc.url" = "jdbc:postgresql://localhost:5432/qtestDB",
> "hive.sql.dbcp.username" = "qtestuser",
> "hive.sql.dbcp.password" = "qtestpassword",
> "hive.sql.table" = "country");
> EXPLAIN CBO SELECT COUNT(*) from country;
> SELECT COUNT(*) from country;
> {code}
> This builds upon HIVE-25423 but proposes to use JDBC datasources without the 
> need for a using a specific CLI driver. Furthermore, the proposed QT option 
> syntax allows using customised init/cleanup scripts for the JDBC datasource 
> per test.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to