-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Upgrade to arrow 23.0.0 #3483
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
Upgrade to arrow 23.0.0 #3483
Changes from all commits
e39e262
d07422c
0fcd94d
5f00b17
cd920b4
8d20841
968d81b
e6c9ced
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,7 +24,7 @@ use std::{any::Any, sync::Arc}; | |
|
||
use arrow::array::*; | ||
use arrow::compute::kernels::arithmetic::{ | ||
add, add_scalar, divide, divide_scalar, modulus, modulus_scalar, multiply, | ||
add, add_scalar, divide_opt, divide_scalar, modulus, modulus_scalar, multiply, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. default |
||
multiply_scalar, subtract, subtract_scalar, | ||
}; | ||
use arrow::compute::kernels::boolean::{and_kleene, not, or_kleene}; | ||
|
@@ -60,7 +60,7 @@ use kernels::{ | |
bitwise_xor, bitwise_xor_scalar, | ||
}; | ||
use kernels_arrow::{ | ||
add_decimal, add_decimal_scalar, divide_decimal, divide_decimal_scalar, | ||
add_decimal, add_decimal_scalar, divide_decimal_scalar, divide_opt_decimal, | ||
eq_decimal_scalar, gt_decimal_scalar, gt_eq_decimal_scalar, is_distinct_from, | ||
is_distinct_from_bool, is_distinct_from_decimal, is_distinct_from_null, | ||
is_distinct_from_utf8, is_not_distinct_from, is_not_distinct_from_bool, | ||
|
@@ -844,7 +844,7 @@ impl BinaryExpr { | |
Operator::Plus => binary_primitive_array_op!(left, right, add), | ||
Operator::Minus => binary_primitive_array_op!(left, right, subtract), | ||
Operator::Multiply => binary_primitive_array_op!(left, right, multiply), | ||
Operator::Divide => binary_primitive_array_op!(left, right, divide), | ||
Operator::Divide => binary_primitive_array_op!(left, right, divide_opt), | ||
Operator::Modulo => binary_primitive_array_op!(left, right, modulus), | ||
Operator::And => { | ||
if left_data_type == &DataType::Boolean { | ||
|
@@ -1326,9 +1326,7 @@ mod tests { | |
let string_type = DataType::Utf8; | ||
|
||
// build dictionary | ||
let keys_builder = PrimitiveBuilder::<Int32Type>::with_capacity(10); | ||
let values_builder = arrow::array::StringBuilder::with_capacity(10, 1024); | ||
let mut dict_builder = StringDictionaryBuilder::new(keys_builder, values_builder); | ||
let mut dict_builder = StringDictionaryBuilder::<Int32Type>::new(); | ||
|
||
dict_builder.append("one")?; | ||
dict_builder.append_null(); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -372,7 +372,7 @@ pub(crate) fn multiply_decimal_scalar( | |
Ok(array) | ||
} | ||
|
||
pub(crate) fn divide_decimal( | ||
pub(crate) fn divide_opt_decimal( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. renamed to be consistent with the arrow rename |
||
left: &Decimal128Array, | ||
right: &Decimal128Array, | ||
) -> Result<Decimal128Array> { | ||
|
@@ -636,7 +636,7 @@ mod tests { | |
25, | ||
3, | ||
); | ||
let result = divide_decimal(&left_decimal_array, &right_decimal_array)?; | ||
let result = divide_opt_decimal(&left_decimal_array, &right_decimal_array)?; | ||
let expect = create_decimal_array( | ||
&[Some(123456700), None, Some(22446672), Some(-10037130), None], | ||
25, | ||
|
@@ -674,7 +674,8 @@ mod tests { | |
let left_decimal_array = create_decimal_array(&[Some(101)], 10, 1); | ||
let right_decimal_array = create_decimal_array(&[Some(0)], 1, 1); | ||
|
||
let err = divide_decimal(&left_decimal_array, &right_decimal_array).unwrap_err(); | ||
let err = | ||
divide_opt_decimal(&left_decimal_array, &right_decimal_array).unwrap_err(); | ||
assert_eq!("Arrow error: Divide by zero error", err.to_string()); | ||
let err = divide_decimal_scalar(&left_decimal_array, 0).unwrap_err(); | ||
assert_eq!("Arrow error: Divide by zero error", err.to_string()); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -88,8 +88,20 @@ def update_version_cargo_toml(cargo_toml, new_version): | |
|
||
for section in ("dependencies", "dev-dependencies"): | ||
for (dep_name, constraint) in doc.get(section, {}).items(): | ||
if dep_name in ("arrow", "parquet", "arrow-flight") and constraint.get("version") is not None: | ||
doc[section][dep_name]["version"] = new_version | ||
if dep_name in ("arrow", "parquet", "arrow-flight"): | ||
if type(constraint) == tomlkit.items.String: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is code I wrote in IOx in https://github.com/influxdata/influxdb_iox/blob/main/scripts/update_arrow_deps.py Basically the previous version didn't handle |
||
# handle constraint that is (only) a string like '12', | ||
doc[section][dep_name] = new_version | ||
elif type(constraint) == dict: | ||
# handle constraint that is itself a struct like | ||
# {'version': '12', 'features': ['prettyprint']} | ||
doc[section][dep_name]["version"] = new_version | ||
elif type(constraint) == tomlkit.items.InlineTable: | ||
# handle constraint that is itself a struct like | ||
# {'version': '12', 'features': ['prettyprint']} | ||
doc[section][dep_name]["version"] = new_version | ||
else: | ||
print("Unknown type for {} {}: {}", dep_name, constraint, type(constraint)) | ||
|
||
with open(cargo_toml, 'w') as f: | ||
f.write(tomlkit.dumps(doc)) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Update to use the nice API @askoa added in apache/arrow-rs#2729