说明
Dremio-3.3.1支持Elasticserch-5.x和6.x;本次使用Elasticserch-6.1.2
1.Elasticserch批量导入数据
## 导入数据
crul -H 'Content-Type: application/json' -XPOST hostname:9200/dremio/entry_index/_bulk?pretty --data-binary @entry_index.json
## 修改副本数
crul -H 'Content-Type: application/json' -XPUT 'hostname:9200/dremio/_settings' -d '{"index":{"number_of_replicas":"0"}}'
注意:文件数据每行头须有“_id”,否则导入数据报错
{"index":{"_id":"id_num"}}
2.数据验证
3.配置ES数据源
4.查询数据
SELECT agent_id,signature,method_type,
max(elapse_time) maxElapseTime,
min(elapse_time) minElapseTime,
avg(elapse_time) avgElapseTime,
sum(CASE WHEN success IS TRUE THEN 1 ELSE 0 END) succCount,
sum(CASE WHEN bad_app IS TRUE THEN 1 ELSE 0 END) badAppCount,
sum(ejb_weight_time) sumEjbWeightTime,
sum(jsp_weight_time) sumJspWeightTime
FROM entry_indx
GROUP BY agent_id,signature,method_type