Skip to content

Add compiler flag to have arithmetic expressions with float-types evaluate to float and not double #202

@icholy

Description

@icholy

When using a float value in an arithmetic expression, the expression incorrectly evaluates to a double instead of float. This leads to a lot of unnecessary casts all over the place.

create schema Thing (value float);
create schema ThingPlusOne (value float);
insert into ThingPlusOne select value + 1 as value from Thing;

Exception in thread "main" com.espertech.esper.compiler.client.EPCompileException: Invalid assignment of column 'value' of type 'java.lang.Double' to event property 'value' typed as 'java.lang.Float', column and parameter types mismatch [insert into ThingPlusOne select value + 1 as value from Thing]

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions