Skip to content

bug: integer arguments can't be casted to floats #20

@petern48

Description

@petern48

Despite the error saying it's DataFusion's code, I suspect this is really our bug and we're just using DataFusionError::Internal somewhere or internal_err!, which returns this misleading bug, as mentioned in this previous PR: #2

> select st_buffer(st_geomfromtext('point (0 0)'), 1);
Internal error: Cannot convert Int64(1) to f64.
This issue was likely caused by a bug in DataFusion's code. Please help us to resolve this by filing a bug report in our issue tracker: https://github.com/apache/datafusion/issues

-- Now, add a ".0" to make it a float, and it now works
> select st_buffer(st_geomfromtext('point (0 0)'), 1.0);
┌──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
│                                   st_buffer(st_geomfromwkt(Utf8("point (0 0)")),Float64(1))                                  │
│                                                              wkb                                                             │
╞══════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════╡
│ POLYGON((1 0,0.9807852804032304 -0.19509032201612825,0.9238795325112867 -0.3826834323650898,0.8314696123025452 -0.555570233… │
└──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘

The same happens with select st_dwithin(st_geomfromtext('point (0 0)'), st_geomfromtext('point (0 0)'), 1);

Datafusion functions like max() still work with ints properly

select max(1);
┌───────────────┐
│ max(Int64(1)) │
│     int64     │
╞═══════════════╡
│             1 │
└───────────────┘

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions