Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Interval Negation Incorrect #4488

Closed
tustvold opened this issue Jul 8, 2023 · 1 comment · Fixed by #4494
Closed

Interval Negation Incorrect #4488

tustvold opened this issue Jul 8, 2023 · 1 comment · Fixed by #4494
Assignees
Labels
arrow Changes to the arrow crate bug

Comments

@tustvold
Copy link
Contributor

tustvold commented Jul 8, 2023

Describe the bug

The negate kernels are incorrect for interval types as they fail to take into account that the values are composite

To Reproduce

#[test]
fn test_negate() {
    let a =
        IntervalMonthDayNanoArray::from(vec![IntervalMonthDayNanoType::make_value(
            1, -5, 2,
        )]);
    let negated = negate(&a).unwrap();
    assert_eq!(
        negated.value(0),
        IntervalMonthDayNanoType::make_value(-1, 5, -2)
    );
}

Expected behavior

Additional context

We should probably deprecate the generic kernels and implement new kernels as part of #1047

@tustvold tustvold added the bug label Jul 8, 2023
@tustvold tustvold self-assigned this Jul 8, 2023
tustvold added a commit to tustvold/arrow-rs that referenced this issue Jul 9, 2023
tustvold added a commit that referenced this issue Jul 10, 2023
* Add negate kernels (#4488)

* Fix doc

* Add Inteval tests

* Review feedback
@tustvold tustvold added the arrow Changes to the arrow crate label Jul 14, 2023
@tustvold
Copy link
Contributor Author

label_issue.py automatically added labels {'arrow'} from #4494

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
arrow Changes to the arrow crate bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant