This is working as expected. In CrateDB, the columns have higher priority in our type inference logic to avoid expensive queries. For E.g. where int_column = 8
(where 8 is a long) shouldn’t result in int_column::long = 8
, but the other way around to utilize the lucene index efficiently.
As a workaround, we would need to add manual casts to the query with integer fields. For the above query, SELECT 1 / (val1 * 1.0 - val2 * 1.0 :: float) from testintfieldval
after the cast (https://crate.io/docs/crate/reference/en/latest/general/ddl/data-types.html?highlight=cast#type-conversion) will return the expected output.