if (fieldSpec.getFieldType().equals(FieldSpec.FieldType.TIME)) { long timeValue; if (value instanceof Number) {
builder.setBitsPerElement(config.getInt(getKeyFor(column, BITS_PER_ELEMENT))); builder.setColumnMaxLength(config.getInt(getKeyFor(column, DICTIONARY_ELEMENT_SIZE))); builder.setFieldType(FieldType.valueOf(config.getString(getKeyFor(column, COLUMN_TYPE)).toUpperCase())); builder.setIsSorted(config.getBoolean(getKeyFor(column, IS_SORTED))); builder.setContainsNulls(config.getBoolean(getKeyFor(column, HAS_NULL_VALUE)));
if (fieldSpec.getFieldType().equals(FieldType.DATE_TIME)) { DateTimeFieldSpec dateTimeFieldSpec = (DateTimeFieldSpec) fieldSpec; properties.setProperty(V1Constants.MetadataKeys.Column.getKeyFor(column, DATETIME_FORMAT),
for (String column : noDictionaryColumns) { FieldSpec fieldSpec = dataSchema.getFieldSpecFor(column); if (fieldSpec.getFieldType().equals(FieldSpec.FieldType.METRIC)) { columnToCompressionType.put(column, ChunkCompressorFactory.CompressionType.PASS_THROUGH);
/** * Helper method that returns compression type to use based on segment creation spec and field type. * <ul> * <li> Returns compression type from segment creation spec, if specified there.</li> * <li> Else, returns PASS_THROUGH for metrics, and SNAPPY for dimensions. This is because metrics are likely * to be spread in different chunks after applying predicates. Same could be true for dimensions, but in that * case, clients are expected to explicitly specify the appropriate compression type in the spec. </li> * </ul> * @param segmentCreationSpec Segment creation spec * @param fieldSpec Field spec for the column * @return Compression type to use */ private ChunkCompressorFactory.CompressionType getColumnCompressionType(SegmentGeneratorConfig segmentCreationSpec, FieldSpec fieldSpec) { ChunkCompressorFactory.CompressionType compressionType = segmentCreationSpec.getRawIndexCompressionType().get(fieldSpec.getName()); if (compressionType == null) { if (fieldSpec.getFieldType().equals(FieldType.METRIC)) { return ChunkCompressorFactory.CompressionType.PASS_THROUGH; } else { return ChunkCompressorFactory.CompressionType.SNAPPY; } } else { return compressionType; } }