Skip to content

abs implementation seems incorrect #642

Closed

Description

@andygrove

Describe the bug

Describe the bug

I was reviewing the abs logic as part of #638 and noticed that it seems incorrect.

In the following code, when running in Legacy mode, it looks like we return the original array if any of the values cause an overflow. What we should be doing instead is returning the original value for the items in the input array that would cause overflow but return the abs of the other values.

Tests are passing, so I may just be misunderstanding something here.

        match self.inner_abs_func.invoke(args) {
            Err(DataFusionError::ArrowError(ArrowError::ComputeError(msg), _trace))
                if msg.contains("overflow") =>
            {
                if self.eval_mode == EvalMode::Legacy {
                    Ok(args[0].clone())

Activity

  1. andygrove commented on Jul 8, 2024

    @andygrove
    MemberAuthor

    I added tests in #638 that confirm the bug

  2. vaibhawvipul commented on Jul 9, 2024

    @vaibhawvipul
    Contributor

    I will work on this after #638 is merged.

  3. added this to the 0.1.0 milestone on Jul 9, 2024
  4. modified the milestones: 0.1.0, 0.2.0 on Jul 9, 2024
  5. andygrove commented on Jul 20, 2024

    @andygrove
    MemberAuthor

    this is a duplicate of #666

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions