Search in sources :

Example 6 with CSVParseSpec

use of io.druid.data.input.impl.CSVParseSpec in project druid by druid-io.

the class JobHelperTest method setup.

@Before
public void setup() throws Exception {
    tmpDir = temporaryFolder.newFile();
    dataFile = temporaryFolder.newFile();
    config = new HadoopDruidIndexerConfig(new HadoopIngestionSpec(new DataSchema("website", HadoopDruidIndexerConfig.JSON_MAPPER.convertValue(new StringInputRowParser(new CSVParseSpec(new TimestampSpec("timestamp", "yyyyMMddHH", null), new DimensionsSpec(DimensionsSpec.getDefaultSchemas(ImmutableList.of("host")), null, null), null, ImmutableList.of("timestamp", "host", "visited_num")), null), Map.class), new AggregatorFactory[] { new LongSumAggregatorFactory("visited_num", "visited_num") }, new UniformGranularitySpec(Granularities.DAY, Granularities.NONE, ImmutableList.of(this.interval)), HadoopDruidIndexerConfig.JSON_MAPPER), new HadoopIOConfig(ImmutableMap.<String, Object>of("paths", dataFile.getCanonicalPath(), "type", "static"), null, tmpDir.getCanonicalPath()), new HadoopTuningConfig(tmpDir.getCanonicalPath(), null, null, null, null, null, false, false, false, false, //Map of job properties
    ImmutableMap.of("fs.s3.impl", "org.apache.hadoop.fs.s3native.NativeS3FileSystem", "fs.s3.awsAccessKeyId", "THISISMYACCESSKEY"), false, false, null, null, null, false, false)));
}
Also used : LongSumAggregatorFactory(io.druid.query.aggregation.LongSumAggregatorFactory) AggregatorFactory(io.druid.query.aggregation.AggregatorFactory) LongSumAggregatorFactory(io.druid.query.aggregation.LongSumAggregatorFactory) DataSchema(io.druid.segment.indexing.DataSchema) UniformGranularitySpec(io.druid.segment.indexing.granularity.UniformGranularitySpec) CSVParseSpec(io.druid.data.input.impl.CSVParseSpec) StringInputRowParser(io.druid.data.input.impl.StringInputRowParser) TimestampSpec(io.druid.data.input.impl.TimestampSpec) DimensionsSpec(io.druid.data.input.impl.DimensionsSpec) Before(org.junit.Before)

Aggregations

CSVParseSpec (io.druid.data.input.impl.CSVParseSpec)6 DimensionsSpec (io.druid.data.input.impl.DimensionsSpec)6 StringInputRowParser (io.druid.data.input.impl.StringInputRowParser)6 TimestampSpec (io.druid.data.input.impl.TimestampSpec)6 AggregatorFactory (io.druid.query.aggregation.AggregatorFactory)3 LongSumAggregatorFactory (io.druid.query.aggregation.LongSumAggregatorFactory)3 OnheapIncrementalIndex (io.druid.segment.incremental.OnheapIncrementalIndex)3 CountAggregatorFactory (io.druid.query.aggregation.CountAggregatorFactory)2 IndexSpec (io.druid.segment.IndexSpec)2 IncrementalIndex (io.druid.segment.incremental.IncrementalIndex)2 DataSchema (io.druid.segment.indexing.DataSchema)2 UniformGranularitySpec (io.druid.segment.indexing.granularity.UniformGranularitySpec)2 ImmutableMap (com.google.common.collect.ImmutableMap)1 JSONParseSpec (io.druid.data.input.impl.JSONParseSpec)1 HyperUniquesAggregatorFactory (io.druid.query.aggregation.hyperloglog.HyperUniquesAggregatorFactory)1 IncrementalIndexSegment (io.druid.segment.IncrementalIndexSegment)1 HashBasedNumberedShardSpec (io.druid.timeline.partition.HashBasedNumberedShardSpec)1 Map (java.util.Map)1 Before (org.junit.Before)1 BeforeClass (org.junit.BeforeClass)1