Uploaded image for project: 'Hive'
  1. Hive
  2. HIVE-25594

Setup JDBC databases in tests via QT options

    XMLWordPrintableJSON

Details

    Description

      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.

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

      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.

      Attachments

        Issue Links

          Activity

            People

              zabetak Stamatis Zampetakis
              zabetak Stamatis Zampetakis
              Votes:
              1 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 3h 40m
                  3h 40m