V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
mortonnex
V2EX  ›  程序员

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

  •  
  •   mortonnex · 2017-05-15 14:58:56 +08:00 · 1715 次点击
    这是一个创建于 2530 天前的主题,其中的信息可能已经有所发展或是发生改变。
    7 条回复    2017-05-15 19:32:38 +08:00
    arsgm
        1
    arsgm  
       2017-05-15 17:35:50 +08:00
    统一加一个假的,或者导入时间作为时间戳
    mortonnex
        2
    mortonnex  
    OP
       2017-05-15 17:57:06 +08:00
    @arsgm 只好这样了,我以为可以通过配置不用修改数据的
    mortonnex
        3
    mortonnex  
    OP
       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
        4
    arsgm  
       2017-05-15 18:30:49 +08:00
    @mortonnex 你得给我看看报错信息吧。。。这个 臣妾看不出来啊。。
    arsgm
        5
    arsgm  
       2017-05-15 18:37:00 +08:00
    @mortonnex "metricsSpec": [
    {
    "type": "count",
    "name": "count",
    "type": "count"
    },

    这个是不对的
    mortonnex
        6
    mortonnex  
    OP
       2017-05-15 18:51:30 +08:00
    @arsgm 大神求个 qq 或者其他联系方式...这个数据导不进去我就 GG 了...
    arsgm
        7
    arsgm  
       2017-05-15 19:32:38 +08:00
    @mortonnex 为啥啊? 673296525
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   5470 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 30ms · UTC 03:00 · PVG 11:00 · LAX 20:00 · JFK 23:00
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.