Uploaded image for project: 'Hive'
  1. Hive
  2. HIVE-14217 Druid integration
  3. HIVE-14470

Read results for Druid TopN query

    XMLWordPrintableJSON

Details

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

    Description

      Format of results for Druid TopN queries is as follows:

      [
        {
          "timestamp": "2013-08-31T00:00:00.000Z",
          "result": [
            {
              "dim1": "dim1_val",
              "count": 111,
              "some_metrics": 10669,
              "average": 96.11711711711712
            },
            {
              "dim1": "another_dim1_val",
              "count": 88,
              "some_metrics": 28344,
              "average": 322.09090909090907
            },
            {
              "dim1": "dim1_val3",
              "count": 70,
              "some_metrics": 871,
              "average": 12.442857142857143
            },
            {
              "dim1": "dim1_val4",
              "count": 62,
              "some_metrics": 815,
              "average": 13.14516129032258
            },
            {
              "dim1": "dim1_val5",
              "count": 60,
              "some_metrics": 2787,
              "average": 46.45
            }
          ]
        }
      ]
      

      Out of this query results, we will generate Hive records with the following format:

      [ new TimestampWritable(new Timestamp(1377907200000L)), new Text("dim1_val"), new LongWritable(111), new FloatWritable(10669F), new FloatWritable(96.11711711711712F) ]
      [ new TimestampWritable(new Timestamp(1377907200000L)), new Text("another_dim1_val"), new LongWritable(88), new FloatWritable(28344F), new FloatWritable(322.09090909090907F) ]
      [ new TimestampWritable(new Timestamp(1377907200000L)), new Text("dim1_val3"), new LongWritable(70), new FloatWritable(871F), new FloatWritable(12.442857142857143F) ]
      [ new TimestampWritable(new Timestamp(1377907200000L)), new Text("dim1_val4"), new LongWritable(62), new FloatWritable(815F), new FloatWritable(13.14516129032258F) ]
      [ new TimestampWritable(new Timestamp(1377907200000L)), new Text("dim1_val5"), new LongWritable(60), new FloatWritable(2787F), new FloatWritable(46.45F) ]
      

      Attachments

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved: