Skip to content

Commit

Permalink
chore: update for deprecated APIs
Browse files Browse the repository at this point in the history
  • Loading branch information
alamb committed Jan 29, 2025
1 parent 1b1b93d commit 7758936
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 11 deletions.
11 changes: 3 additions & 8 deletions datafusion/core/src/datasource/physical_plan/arrow_file.rs
Original file line number Diff line number Diff line change
Expand Up @@ -309,10 +309,8 @@ impl FileOpener for ArrowOpener {
for (dict_block, dict_result) in
footer.dictionaries().iter().flatten().zip(dict_results)
{
decoder.read_dictionary(
dict_block,
&Buffer::from_bytes(dict_result.into()),
)?;
decoder
.read_dictionary(dict_block, &Buffer::from(dict_result))?;
}

// filter recordbatches according to range
Expand Down Expand Up @@ -348,10 +346,7 @@ impl FileOpener for ArrowOpener {
.zip(recordbatch_results)
.filter_map(move |(block, data)| {
decoder
.read_record_batch(
&block,
&Buffer::from_bytes(data.into()),
)
.read_record_batch(&block, &Buffer::from(data))
.transpose()
}),
)
Expand Down
7 changes: 4 additions & 3 deletions datafusion/optimizer/src/unwrap_cast_in_comparison.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ use crate::{OptimizerConfig, OptimizerRule};

use crate::utils::NamePreserver;
use arrow::datatypes::{
DataType, TimeUnit, MAX_DECIMAL_FOR_EACH_PRECISION, MIN_DECIMAL_FOR_EACH_PRECISION,
DataType, TimeUnit, MAX_DECIMAL128_FOR_EACH_PRECISION,
MIN_DECIMAL128_FOR_EACH_PRECISION,
};
use arrow::temporal_conversions::{MICROSECONDS, MILLISECONDS, NANOSECONDS};
use datafusion_common::tree_node::{Transformed, TreeNode, TreeNodeRewriter};
Expand Down Expand Up @@ -369,8 +370,8 @@ fn try_cast_numeric_literal(
// Different precision for decimal128 can store different range of value.
// For example, the precision is 3, the max of value is `999` and the min
// value is `-999`
MIN_DECIMAL_FOR_EACH_PRECISION[*precision as usize - 1],
MAX_DECIMAL_FOR_EACH_PRECISION[*precision as usize - 1],
MIN_DECIMAL128_FOR_EACH_PRECISION[*precision as usize],
MAX_DECIMAL128_FOR_EACH_PRECISION[*precision as usize],
),
_ => return None,
};
Expand Down

0 comments on commit 7758936

Please sign in to comment.