weld-project / weld

High-performance runtime for data analytics applications
https://www.weld.rs
BSD 3-Clause "New" or "Revised" License
2.99k stars 259 forks source link

Addresses issue with incorrect min/max initialization in codegen #450

Closed sppalkia closed 5 years ago

sppalkia commented 5 years ago

Previously, the binop_identity function in code generation initialized both signed and unsigned integers were initialized with ::std::u32/64::MIN/MAX for max and min respectively; however, this is an incorrect initialization value for signed (e.g., i64) values.

For example, finding the min of [1, 2, 3, 4, 5] with an initial builder value of ::std::u64::MAX would cause the value in the builder to be -1, resulting an an incorrect result. This patch fixes this issue.