use of org.apache.hadoop.hive.druid.serde.DruidSerDeUtils.ISO_TIME_FORMAT in project hive by apache.
the class DruidGroupByQueryRecordReader method initDimensionTypes.
private void initDimensionTypes() throws IOException {
// @TODO move this out of here to org.apache.hadoop.hive.druid.serde.DruidSerDe
List<DimensionSpec> dimensionSpecList = ((GroupByQuery) query).getDimensions();
List<DimensionSpec> extractionDimensionSpecList = dimensionSpecList.stream().filter(dimensionSpecs -> dimensionSpecs instanceof ExtractionDimensionSpec).collect(Collectors.toList());
extractionDimensionSpecList.stream().forEach(dimensionSpec -> {
ExtractionDimensionSpec extractionDimensionSpec = (ExtractionDimensionSpec) dimensionSpec;
if (extractionDimensionSpec.getExtractionFn() instanceof TimeFormatExtractionFn) {
final TimeFormatExtractionFn timeFormatExtractionFn = (TimeFormatExtractionFn) extractionDimensionSpec.getExtractionFn();
if (timeFormatExtractionFn == null || timeFormatExtractionFn.getFormat().equals(ISO_TIME_FORMAT)) {
timeExtractionFields.add(extractionDimensionSpec.getOutputName());
} else {
intFormattedTimeExtractionFields.add(extractionDimensionSpec.getOutputName());
}
}
});
}
Aggregations