druid 添加数据时候,数据没有时间戳字段怎么

2017-05-15 14:58:56 +08:00
 mortonnex
1732 次点击
所在节点    程序员
7 条回复
arsgm
2017-05-15 17:35:50 +08:00
统一加一个假的,或者导入时间作为时间戳
mortonnex
2017-05-15 17:57:06 +08:00
@arsgm 只好这样了,我以为可以通过配置不用修改数据的
mortonnex
2017-05-15 17:59:04 +08:00
@arsgm

```json

{
"type" : "index",
"spec" : {
"dataSchema" : {
"dataSource" : "order",
"parser" : {
"type" : "string",
"parseSpec" : {
"format" : "csv",
"columns":["time","user_id","r","f","m"],
"dimensionsSpec" : {
"dimensions" : [{"type":"long","name":"user_id"}
]
},
"timestampSpec" : {
"format" : "auto",
"column" : "time"
}
}
},
"metricsSpec" : [
{ "type" : "count", "name" : "count", "type" : "count" },
{ "type" : "longSum", "name" : "r", "fieldName" : "r" },
{ "type" : "longSum", "name" : "f", "fieldName" : "f" },
{ "type" : "longSum", "name" : "m", "fieldName" : "m" }
],
"granularitySpec" : {
"type" : "uniform",
"segmentGranularity" : "day",
"queryGranularity" : "none",
"intervals": ["2015-09-01/2015-09-02"]
}
},
"ioConfig" : {
"type" : "index",
"firehose" : {
"type" : "local",
"baseDir" : "quickstart/",
"filter" : "rfm_data_after.csv"
},
"appendToExisting" : false
},
"tuningConfig" : {
"type" : "index",
"targetPartitionSize" : 5000000,
"maxRowsInMemory" : 25000,
"forceExtendableShardSpecs" : true
}
}
}

```

数据示例:

```
2015-09-01T01:30:00Z6,40,51,78.84019607843138
2015-09-01T01:30:00Z12,20,28,48.86678571428571
2015-09-01T01:30:00Z18,335,1,19.9
2015-09-01T01:30:00Z30,2,2,114.2
```

URL:

```
curl -X 'POST' -H 'Content-Type:application/json' -d @order-task.json localhost:8090/druid/indexer/v1/task
```

导入不进去数据是怎么回事????
arsgm
2017-05-15 18:30:49 +08:00
@mortonnex 你得给我看看报错信息吧。。。这个 臣妾看不出来啊。。
arsgm
2017-05-15 18:37:00 +08:00
@mortonnex "metricsSpec": [
{
"type": "count",
"name": "count",
"type": "count"
},

这个是不对的
mortonnex
2017-05-15 18:51:30 +08:00
@arsgm 大神求个 qq 或者其他联系方式...这个数据导不进去我就 GG 了...
arsgm
2017-05-15 19:32:38 +08:00
@mortonnex 为啥啊? 673296525

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/361432

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX