Druid supports Long as a basic type for dimensions...
# dev
s
Druid supports Long as a basic type for dimensions. But ingesting integer values as dimensions also works which means Druid is casting Integers to Long type somewhere while reading the segment. Could somebody help me understand how this casting works or point to the class which may be responsible for this? Thanks!
Seems like this is within
DimensionHandlerUtils.convertObjectToLong()
c
yea, the values are cast during ingestion, if you specify ‘long’ in the dimension schema currently it goes through https://github.com/apache/druid/blob/master/processing/src/main/java/org/apache/druid/segment/LongDimensionIndexer.java#L56
‘auto’ can also ingest long columns, though goes through a slightly different path, and uses the native expression processing to coerce the values to longs https://github.com/apache/druid/blob/master/processing/src/main/java/org/apache/druid/segment/AutoTypeColumnIndexer.java