Uploaded image for project: 'Hive'
  1. Hive
  2. HIVE-14473 Druid integration II
  3. HIVE-14474

Create datasource in Druid from Hive

    XMLWordPrintableJSON

Details

    • Sub-task
    • Status: Resolved
    • Major
    • Resolution: Duplicate
    • 2.2.0
    • None
    • Druid integration
    • None

    Description

      We want to extend the DruidStorageHandler to support CTAS queries.

      In the initial implementation proposed in this issue, we will write the results of the query to HDFS (or the location specified in the CTAS statement), and submit a HadoopIndexing task to the Druid overlord. The task will contain the path where data was stored, it will read it and create the segments in Druid. Once this is done, the results are removed from Hive.

      The syntax will be as follows:

      CREATE TABLE druid_table_1
      STORED BY 'org.apache.hadoop.hive.druid.DruidStorageHandler'
      TBLPROPERTIES ("druid.datasource" = "my_query_based_datasource")
      AS <input_query>;
      

      This statement stores the results of query <input_query> in a Druid datasource named 'my_query_based_datasource'. One of the columns of the query needs to be the time dimension, which is mandatory in Druid. In particular, we use the same convention that it is used for Druid: there needs to be a the column named '__time' in the result of the executed query, which will act as the time dimension column in Druid. Currently, the time column dimension needs to be a 'timestamp' type column.

      This initial implementation interacts with Druid API as it is currently exposed to the user. In a follow-up issue, we should propose an implementation that integrates tighter with Druid. In particular, we would like to store segments directly in Druid from Hive, thus avoiding the overhead of writing Hive results to HDFS and then launching a MR job that basically reads them again to create the segments.

      Attachments

        1. HIVE-14474.patch
          51 kB
          jcamachorodriguez
        2. HIVE-14474.01.patch
          55 kB
          jcamachorodriguez
        3. HIVE-14474.02.patch
          59 kB
          jcamachorodriguez
        4. HIVE-14474.03.patch
          61 kB
          jcamachorodriguez
        5. HIVE-14474.04.patch
          62 kB
          jcamachorodriguez

        Issue Links

          Activity

            People

              jcamacho Jesús Camacho Rodríguez
              jcamacho Jesús Camacho Rodríguez
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: