Skip to content

Conversation

@izveigor
Copy link
Contributor

@izveigor izveigor commented May 8, 2023

Which issue does this PR close?

Rationale for this change

Support Float16Type in cast.

What changes are included in this PR?

Are there any user-facing changes?

Yes

@github-actions github-actions bot added the arrow Changes to the arrow crate label May 8, 2023
Copy link
Contributor

@tustvold tustvold left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some of the overflow behaviour seems unexpected, I could be mistaken but I thought that f16 had a similar range to f32, just lower precision?

let f16_array: ArrayRef = Arc::new(Float16Array::from(f16_values));

let f64_expected = vec![
"-inf", "-inf", "-32768.0", "-128.0", "0.0", "255.0", "inf", "inf", "inf",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

-inf seems off here, unless the original value was f16::NEG_INFINITY ?

@izveigor izveigor marked this pull request as draft May 15, 2023 18:41
];
let f16_array: ArrayRef = Arc::new(Float16Array::from(f16_values));

let f64_expected = vec!["-inf", "-32768.0", "-128.0", "0.0", "255.0", "inf"];
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't find the way in the package half how to replace inf with `null. Is this a serious problem?

@izveigor
Copy link
Contributor Author

@tustvold Sorry for the long delay. I left a few questions on this PR. Can you pay attention to them if you have time.

@izveigor izveigor marked this pull request as ready for review May 30, 2023 20:22
@izveigor izveigor marked this pull request as draft June 11, 2023 16:34
@izveigor izveigor marked this pull request as ready for review June 15, 2023 17:32
@izveigor
Copy link
Contributor Author

So, what about this PR @tustvold.
If you're worried about the "infinity" and "decimal" problem, I can tell that they are part of the algorithm and are considered correct.

@izveigor izveigor closed this Sep 16, 2023
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants