Skip to content
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

Map access for expressions #352

Open
wants to merge 16 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions derive-macros/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ use syn::{parse_macro_input, Data, DataStruct, DeriveInput, Fields, Meta, PathAr
/// delta schema camelCase version).
///
/// If a field sets `drop_null_container_values`, it means the underlying data can contain null in
/// the values of the container (i.e. a `key` -> `null` in a `HashMap`). Therefore the schema should
/// the values of the container (i.e. a `key` -> `null` in a `HashMap`). Therefore, the schema should
/// mark the value field as nullable, but those mappings will be dropped when converting to an
/// actual rust `HashMap`. Currently this can _only_ be set on `HashMap` fields.
/// actual rust `HashMap`. Currently, this can _only_ be set on `HashMap` fields.
#[proc_macro_derive(Schema, attributes(drop_null_container_values))]
pub fn derive_schema(input: proc_macro::TokenStream) -> proc_macro::TokenStream {
let input = parse_macro_input!(input as DeriveInput);
Expand Down
10 changes: 5 additions & 5 deletions ffi/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ crate-type = ["lib", "cdylib", "staticlib"]
tracing = "0.1"
url = "2"
delta_kernel = { path = "../kernel", default-features = false, features = [
"developer-visibility",
"developer-visibility",
] }
delta_kernel_ffi_macros = { path = "../ffi-proc-macros", version = "0.3.1" }

Expand All @@ -40,10 +40,10 @@ trybuild = "1.0"
[features]
default = ["default-engine"]
default-engine = [
"delta_kernel/default-engine",
"arrow-array",
"arrow-data",
"arrow-schema",
"delta_kernel/default-engine",
"arrow-array",
"arrow-data",
"arrow-schema",
]
sync-engine = ["delta_kernel/sync-engine"]
developer-visibility = []
66 changes: 34 additions & 32 deletions kernel/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ repository.workspace = true
readme.workspace = true
version.workspace = true
# exclude golden tests + golden test data since they push us over 10MB crate size limit
exclude = ["tests/golden_tables.rs", "tests/golden_data/" ]
exclude = ["tests/golden_tables.rs", "tests/golden_data/"]

[package.metadata.docs.rs]
all-features = true
Expand Down Expand Up @@ -39,6 +39,7 @@ visibility = "0.1.1"

# Used in default engine
arrow-buffer = { workspace = true, optional = true }
arrow-data = { workspace = true, optional = true }
arrow-array = { workspace = true, optional = true, features = ["chrono-tz"] }
arrow-select = { workspace = true, optional = true }
arrow-arith = { workspace = true, optional = true }
Expand Down Expand Up @@ -67,44 +68,45 @@ walkdir = { workspace = true, optional = true }
arrow-conversion = ["arrow-schema"]
arrow-expression = ["arrow-arith", "arrow-array", "arrow-buffer", "arrow-ord", "arrow-schema"]
cloud = [
"object_store/aws",
"object_store/azure",
"object_store/gcp",
"object_store/http",
"hdfs-native-object-store",
"object_store/aws",
"object_store/azure",
"object_store/gcp",
"object_store/http",
"hdfs-native-object-store",
]
default = []
default-engine = [
"arrow-conversion",
"arrow-expression",
"arrow-array",
"arrow-buffer",
"arrow-cast",
"arrow-json",
"arrow-schema",
"arrow-select",
"futures",
"object_store",
"parquet/async",
"parquet/object_store",
"reqwest",
"tokio",
"arrow-conversion",
"arrow-expression",
"arrow-array",
"arrow-data",
"arrow-buffer",
"arrow-cast",
"arrow-json",
"arrow-schema",
"arrow-select",
"futures",
"object_store",
"parquet/async",
"parquet/object_store",
"reqwest",
"tokio",
]

developer-visibility = []
sync-engine = [
"arrow-cast",
"arrow-conversion",
"arrow-expression",
"arrow-array",
"arrow-json",
"arrow-select",
"parquet",
"arrow-cast",
"arrow-conversion",
"arrow-expression",
"arrow-array",
"arrow-json",
"arrow-select",
"parquet",
]
integration-test = [
"hdfs-native-object-store/integration-test",
"hdfs-native",
"walkdir",
"hdfs-native-object-store/integration-test",
"hdfs-native",
"walkdir",
]

[build-dependencies]
Expand All @@ -119,6 +121,6 @@ tempfile = "3"
tar = "0.4"
zstd = "0.13"
tracing-subscriber = { version = "0.3", default-features = false, features = [
"env-filter",
"fmt",
"env-filter",
"fmt",
] }
2 changes: 1 addition & 1 deletion kernel/src/engine/arrow_data.rs
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ where
}

impl EngineMap for MapArray {
fn get<'a>(&'a self, row_index: usize, key: &str) -> Option<&'a str> {
fn get(&self, row_index: usize, key: &str) -> Option<&str> {
let offsets = self.offsets();
let start_offset = offsets[row_index] as usize;
let count = offsets[row_index + 1] as usize - start_offset;
Expand Down
Loading
Loading