use of com.linkedin.pinot.common.data.TimeFieldSpec in project pinot by linkedin.
the class TransformGroupByTest method buildSchema.
/**
* Helper method to build a schema with one string dimension, and one double metric columns.
*/
private static Schema buildSchema() {
Schema schema = new Schema();
DimensionFieldSpec dimensionFieldSpec = new DimensionFieldSpec(DIMENSION_NAME, FieldSpec.DataType.STRING, true);
schema.addField(dimensionFieldSpec);
MetricFieldSpec metricFieldSpec = new MetricFieldSpec(METRIC_NAME, FieldSpec.DataType.DOUBLE);
schema.addField(metricFieldSpec);
TimeFieldSpec timeFieldSpec = new TimeFieldSpec(TIME_COLUMN_NAME, FieldSpec.DataType.LONG, TimeUnit.MILLISECONDS);
schema.setTimeFieldSpec(timeFieldSpec);
return schema;
}
use of com.linkedin.pinot.common.data.TimeFieldSpec in project pinot by linkedin.
the class PinotSegmentRecordReaderTest method createPinotSchema.
private Schema createPinotSchema() {
Schema testSchema = new Schema();
testSchema.setSchemaName("schema");
FieldSpec spec;
spec = new DimensionFieldSpec(D_SV_1, DataType.STRING, true);
testSchema.addField(spec);
spec = new DimensionFieldSpec(D_MV_1, DataType.STRING, false);
testSchema.addField(spec);
spec = new MetricFieldSpec(M1, DataType.INT);
testSchema.addField(spec);
spec = new MetricFieldSpec(M2, DataType.FLOAT);
testSchema.addField(spec);
spec = new TimeFieldSpec(new TimeGranularitySpec(DataType.LONG, TimeUnit.HOURS, TIME));
testSchema.addField(spec);
return testSchema;
}
Aggregations