在Druid中对ABS数据源运行查询时,我得到了一些计数,但是当同一查询使用ABS_DAILY数据源运行时,计数有所不同。然后我们从ABS制作ABS_DAILY。
{
"queryType" : "groupBy",
"dataSource" : "ABS",
"granularity" : "all",
"intervals" : [ "2018-07-12T00:00:00.000Z/2018-07-13T00:00:00.000Z" ],
"descending" : "false",
"aggregations" : [ {
"type" : "count",
"name" : "COUNT",
"fieldName" : "COUNT"
} ],
"postAggregations" : [ ],
"dimensions" : [ "event_id" ]
}
以下用于提交德鲁伊日常工作的json,它将在特定时间为ABS_DALIY创建细分
{
"spec": {
"ioConfig": {
"firehose": {
"dataSource": "ABS",
"interval": "2018-07-12T00:00:00.000Z/2018-07-13T00:00:00.000Z",
"metrics": null,
"dimensions": null,
"type": "ingestSegment"
},
"type": "index"
},
"dataSchema": {
"granularitySpec": {
"queryGranularity": "day",
"intervals": [
"2018-07-12T00:00:00.000Z/2018-07-13T00:00:00.000Z"
],
"segmentGranularity": "day",
"type": "uniform"
},
"dataSource": "ABS_DAILY",
"metricsSpec": [],
"parser": {
"parseSpec": {
"timestampSpec": {
"column": "server_timestamp",
"format": "dd MMMM, yyyy (HH:mm:ss)"
},
"dimensionsSpec": {
"dimensionExclusions": [
"server_timestamp"
],
"dimensions": []
},
"format": "json"
},
"type": "string"
}
}
},
"type": "index"
}
我要求ABS_DAILY在其下方返回与ABS Count不同的结果。哪个不应该。
{
"queryType" : "groupBy",
"dataSource" : "ERS_DAILY",
"granularity" : "all",
"intervals" : [ "2018-07-12T00:00:00.000Z/2018-07-13T00:00:00.000Z" ],
"descending" : "false",
"aggregations" : [ {
"type" : "count",
"name" : "COUNT",
"fieldName" : "COUNT"
} ],
"postAggregations" : [ ],
"dimensions" : [ "event_id" ]
}
答案 0 :(得分:1)
您正在计算每日汇总的行。
要汇总预先汇总的计数,您现在需要对计数列求和(请参见{!!Form::model($screening,['method'=>'post', 'action'=>
['ReserveController@store',$screening->auditorium->id]])!!}
<input type="hidden" name="screening_id" value="{{$screening->id}}">
@foreach($seats as $seat)
<label class="checkbox-inline">
{!!Form::checkbox('seat_id[]',$seat->id,null)!!} Number: {{$seat->number}}
</label>
@endforeach
<div class='form-group'>
{!!Form::submit('Create Post',['class'=>'btn btn-primary '])!!}
</div>
{!!Form::close()!!}
)
public function store(Request $request){
$screening_id = $request->screening_id;
$seat_ids = $request->seat_id;
foreach($seat_ids as $seat_id){
Seatreserved::create($seat_id,$screening_id);
}
}