fix druid incorrect real data value for DruidBrokerPageSource
@@ -44,6 +44,7 @@ import java.util.List;
import static com.facebook.presto.druid.DruidErrorCode.DRUID_BROKER_RESULT_ERROR;
import static com.google.common.collect.ImmutableList.toImmutableList;
+import static java.lang.Float.floatToRawIntBits;
import static java.util.Objects.requireNonNull;
public class DruidBrokerPageSource
@@ -137,7 +138,7 @@ public class DruidBrokerPageSource
type.writeDouble(blockBuilder, value.doubleValue());
}
else if (type instanceof RealType) {
- type.writeLong(blockBuilder, value.longValue());
+ type.writeLong(blockBuilder, floatToRawIntBits(value.floatValue()));
}
else if (type instanceof TimestampType) {
DateTimeFormatter formatter = ISODateTimeFormat.dateTimeParser()
