Skip to content

Commit

Permalink
chore: kernel changes
Browse files Browse the repository at this point in the history
  • Loading branch information
ion-elgreco committed Dec 1, 2024
1 parent dc72bd9 commit a6c27ff
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
16 changes: 8 additions & 8 deletions crates/core/src/kernel/snapshot/log_data.rs
Original file line number Diff line number Diff line change
Expand Up @@ -500,7 +500,7 @@ mod datafusion {
use delta_kernel::expressions::Expression;
use delta_kernel::schema::{DataType, PrimitiveType};
use delta_kernel::{ExpressionEvaluator, ExpressionHandler};

use delta_kernel::AsAny;
use super::*;
use crate::kernel::arrow::extract::{extract_and_cast_opt, extract_column};
use crate::kernel::ARROW_HANDLER;
Expand Down Expand Up @@ -725,9 +725,9 @@ mod datafusion {
return None;
}
let expression = if self.metadata.partition_columns.contains(&column.name) {
Expression::Column(format!("add.partitionValues_parsed.{}", column.name))
Expression::column(vec![format!("add.partitionValues_parsed.{}", column.name)].into_iter())
} else {
Expression::Column(format!("add.stats_parsed.{}.{}", stats_field, column.name))
Expression::column(vec![format!("add.stats_parsed.{}.{}", stats_field, column.name)].into_iter())
};
let evaluator = ARROW_HANDLER.get_evaluator(
crate::kernel::models::fields::log_schema_ref().clone(),
Expand All @@ -737,9 +737,9 @@ mod datafusion {
let mut results = Vec::with_capacity(self.data.len());
for batch in self.data.iter() {
let engine = ArrowEngineData::new(batch.clone());
let result = evaluator.evaluate(&engine).ok()?;
let result = Arc::new(evaluator.evaluate(&engine).ok()?);
let result = result
.as_any()
.any_ref()
.downcast_ref::<ArrowEngineData>()
.ok_or(DeltaTableError::generic(
"failed to downcast evaluator result to ArrowEngineData.",
Expand Down Expand Up @@ -803,16 +803,16 @@ mod datafusion {
lazy_static::lazy_static! {
static ref ROW_COUNTS_EVAL: Arc<dyn ExpressionEvaluator> = ARROW_HANDLER.get_evaluator(
crate::kernel::models::fields::log_schema_ref().clone(),
Expression::column("add.stats_parsed.numRecords"),
Expression::column(vec!["add.stats_parsed.numRecords"].into_iter()),
DataType::Primitive(PrimitiveType::Long),
);
}
let mut results = Vec::with_capacity(self.data.len());
for batch in self.data.iter() {
let engine = ArrowEngineData::new(batch.clone());
let result = ROW_COUNTS_EVAL.evaluate(&engine).ok()?;
let result = Arc::new(ROW_COUNTS_EVAL.evaluate(&engine).ok()?);
let result = result
.as_any()
.any_ref()
.downcast_ref::<ArrowEngineData>()
.ok_or(DeltaTableError::generic(
"failed to downcast evaluator result to ArrowEngineData.",
Expand Down
2 changes: 1 addition & 1 deletion crates/core/src/table/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
use std::time::Duration;
use std::{collections::HashMap, str::FromStr};

use delta_kernel::features::ColumnMappingMode;
use delta_kernel::table_features::ColumnMappingMode;
use lazy_static::lazy_static;
use serde::{Deserialize, Serialize};

Expand Down
2 changes: 1 addition & 1 deletion crates/core/src/table/state_arrow.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ use arrow_array::{
use arrow_cast::cast;
use arrow_cast::parse::Parser;
use arrow_schema::{DataType, Field, Fields, TimeUnit};
use delta_kernel::features::ColumnMappingMode;
use delta_kernel::table_features::ColumnMappingMode;
use itertools::Itertools;

use super::state::DeltaTableState;
Expand Down

0 comments on commit a6c27ff

Please sign in to comment.