Re: [DISCUSS][Java] Provide an interface for numeric vectors

2019-08-20 Thread Fan Liya
As suggested by Micah, there are some problems with the common interface for numeric types: 1. corner cases for transforming special floating point values, like NaN, inf, etc. 2. loss of precision when transforming long to double. Instead, we provide a common interface for float4 & float8 values.

Re: [DISCUSS][Java] Provide an interface for numeric vectors

2019-08-14 Thread Fan Liya
Hi Micah, Thanks for the good points. I agree with you that we should improve the efficiency of algorithms. This is related to another improvement: reduce the if/switch statements in the code. To account for the edge cases, can we remove the set methods, and leaving only the get method? This is

Re: [DISCUSS][Java] Provide an interface for numeric vectors

2019-08-14 Thread Micah Kornfield
Hi Liya Fan, I'm not sure if this is a good idea. First, floating point operations have more edge cases than integer arithmetic (e.g. dealing with NaNs). Second, and I apologize that I've been remiss in thinking this through on reviews, but I think we should be thinking about how to make

[jira] [Created] (ARROW-6245) [DISCUSS][Java] Provide an interface for numeric vectors

2019-08-14 Thread Liya Fan (JIRA)
Liya Fan created ARROW-6245: --- Summary: [DISCUSS][Java] Provide an interface for numeric vectors Key: ARROW-6245 URL: https://issues.apache.org/jira/browse/ARROW-6245 Project: Apache Arrow Issue

[DISCUSS][Java] Provide an interface for numeric vectors

2019-08-14 Thread Fan Liya
Dear all, We want to provide an interface for all vectors with numeric types (small int, float4, float8, etc). This interface will make it convenient for many operations on a vector, like average, sum, variance, etc. With this interface, the client code will be greatly simplified, with many