2017-05-27 1 views

Répondre

0

En supposant que vous avez déjà installé Druid et Yarn/MapReduce, vous pouvez lancer une tâche index_hadoop qui répondra à vos questions.

Il y a un druide-orcs extensions qui permet de lire le fichier ORC, je ne pense pas venir avec la version standard, donc vous devrez obtenir une certaine façon (nous construisons de la source)

(liste d'extension http://druid.io/docs/latest/development/extensions.html)


Voici un exemple qui ingérerait un tas de fichier orc et ajoutez un intervalle à une source de données. POST à ​​un suzerain http: // Overlord: 8090/druide/indexeur/v1/tâche

(doc http://druid.io/docs/latest/ingestion/batch-ingestion.html)

Vous devrez peut-être ajuster en fonction de votre distribution, je me souviens que nous avions émettons pour hortonworks avec une classe non trouvée (classpathPrefix aidera à ajuster le classpath de MapReduce)

{ 
    "type": "index_hadoop", 
    "spec": { 
    "ioConfig": { 
     "type": "hadoop", 
     "inputSpec": { 
     "type": "granularity", 
     "inputFormat": "org.apache.hadoop.hive.ql.io.orc.OrcNewInputFormat", 
     "dataGranularity": "hour", 
     "inputPath": "/apps/hive/warehouse/table1", 
     "filePattern": ".*", 
     "pathFormat": "'partition='yyyy-MM-dd'T'HH" 
     } 
    }, 
    "dataSchema": { 
     "dataSource": "cube_indexed_from_orc", 
     "parser": { 
     "type": "orc", 
     "parseSpec": { 
      "format": "timeAndDims", 
      "timestampSpec": { 
      "column": "timestamp", 
      "format": "nano" 
      }, 
      "dimensionsSpec": { 
      "dimensions": ["cola", "colb", "colc"], 
      "dimensionExclusions": [], 
      "spatialDimensions": [] 
      } 
     }, 
     "typeString": "struct<timestamp:bigint,cola:bigint,colb:string,colc:string,cold:bigint>" 
     }, 
     "metricsSpec": [{ 
     "type": "count", 
     "name": "count" 
     }], 
     "granularitySpec": { 
     "type": "uniform", 
     "segmentGranularity": "DAY", 
     "queryGranularity": "HOUR", 
     "intervals": ["2017-06-14T00:00:00.000Z/2017-06-15T00:00:00.000Z"] 
     } 
    }, 
    "tuningConfig": { 
     "type": "hadoop", 
     "partitionsSpec": { 
     "type": "hashed", 
     "targetPartitionSize": 5000000 
     }, 
     "leaveIntermediate": false, 
     "forceExtendableShardSpecs": "true" 
    } 
    } 
} 
+0

Merci beaucoup pour vos commentaires Pierre – user2359902