• 请不要在回答技术问题时复制粘贴 AI 生成的内容
mortonnex
V2EX  ›  程序员

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

  •  
  •   mortonnex · May 15, 2017 · 2228 views
    This topic created in 3355 days ago, the information mentioned may be changed or developed.
    7 replies    2017-05-15 19:32:38 +08:00
    arsgm
        1
    arsgm  
       May 15, 2017
    统一加一个假的,或者导入时间作为时间戳
    mortonnex
        2
    mortonnex  
    OP
       May 15, 2017
    @arsgm 只好这样了,我以为可以通过配置不用修改数据的
    mortonnex
        3
    mortonnex  
    OP
       May 15, 2017
    @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  
       May 15, 2017
    @mortonnex 你得给我看看报错信息吧。。。这个 臣妾看不出来啊。。
    arsgm
        5
    arsgm  
       May 15, 2017
    @mortonnex "metricsSpec": [
    {
    "type": "count",
    "name": "count",
    "type": "count"
    },

    这个是不对的
    mortonnex
        6
    mortonnex  
    OP
       May 15, 2017
    @arsgm 大神求个 qq 或者其他联系方式...这个数据导不进去我就 GG 了...
    arsgm
        7
    arsgm  
       May 15, 2017
    @mortonnex 为啥啊? 673296525
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   1003 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 29ms · UTC 19:22 · PVG 03:22 · LAX 12:22 · JFK 15:22
    ♥ Do have faith in what you're doing.