You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hive.apache.org by "Jesus Camacho Rodriguez (JIRA)" <ji...@apache.org> on 2016/08/08 11:52:20 UTC

[jira] [Created] (HIVE-14470) Read results for Druid TopN query

Jesus Camacho Rodriguez created HIVE-14470:
----------------------------------------------

             Summary: Read results for Druid TopN query
                 Key: HIVE-14470
                 URL: https://issues.apache.org/jira/browse/HIVE-14470
             Project: Hive
          Issue Type: Sub-task
          Components: Druid integration
    Affects Versions: 2.2.0
            Reporter: Jesus Camacho Rodriguez
            Assignee: Jesus Camacho Rodriguez


Format of results for Druid TopN queries is as follows:

{code:json}
[
  {
    "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
      }
    ]
  }
]
{code}

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

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



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)