Class AbstractSegmentMetadataCache.FirstTypeMergePolicy
- java.lang.Object
-
- org.apache.druid.segment.metadata.AbstractSegmentMetadataCache.FirstTypeMergePolicy
-
- All Implemented Interfaces:
AbstractSegmentMetadataCache.ColumnTypeMergePolicy
- Enclosing class:
- AbstractSegmentMetadataCache<T extends DataSourceInformation>
public static class AbstractSegmentMetadataCache.FirstTypeMergePolicy extends Object implements AbstractSegmentMetadataCache.ColumnTypeMergePolicy
Classic logic, we use the first type we encounter. This policy is effectively 'newest first' because we iterated segments starting from the most recent time chunk, so this typically results in the most recently used type being chosen, at least for systems that are continuously updated with 'current' data. SinceAbstractSegmentMetadataCache.ColumnTypeMergePolicyare used to compute the SQL schema, at least in systems using SQL schemas which are partially or fully computed by this cache, this merge policy can result in query time errors if incompatible types are mixed if the chosen type is more restrictive than the types of some segments. If data is likely to vary in type across segments, consider usingAbstractSegmentMetadataCache.LeastRestrictiveTypeMergePolicyinstead.
-
-
Constructor Summary
Constructors Constructor Description FirstTypeMergePolicy()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object o)inthashCode()org.apache.druid.segment.column.ColumnTypemerge(org.apache.druid.segment.column.ColumnType existingType, org.apache.druid.segment.column.ColumnType newType)StringtoString()
-
-
-
Field Detail
-
NAME
public static final String NAME
- See Also:
- Constant Field Values
-
-
Method Detail
-
merge
public org.apache.druid.segment.column.ColumnType merge(org.apache.druid.segment.column.ColumnType existingType, org.apache.druid.segment.column.ColumnType newType)- Specified by:
mergein interfaceAbstractSegmentMetadataCache.ColumnTypeMergePolicy
-
-