Skip to content
Draft
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
1 change: 1 addition & 0 deletions java/lance-jni/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions python/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions rust/lance-namespace-impls/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ rust-version.workspace = true
[features]
default = ["dir-aws", "dir-azure", "dir-gcp", "dir-oss", "dir-huggingface"]
rest = ["dep:reqwest"]
rest-adapter = ["dep:axum", "dep:tower", "dep:tower-http", "dep:serde"]
rest-adapter = ["dep:axum", "dep:tower", "dep:tower-http"]
# Cloud storage features for directory implementation - align with lance-io
dir-gcp = ["lance-io/gcp", "lance/gcp"]
dir-aws = ["lance-io/aws", "lance/aws"]
Expand All @@ -23,7 +23,7 @@ dir-oss = ["lance-io/oss", "lance/oss"]
dir-huggingface = ["lance-io/huggingface", "lance/huggingface"]
# Credential vending features
credential-vendor-aws = ["dep:aws-sdk-sts", "dep:aws-config", "dep:aws-credential-types", "dep:sha2", "dep:base64"]
credential-vendor-gcp = ["dep:google-cloud-auth", "dep:reqwest", "dep:serde", "dep:sha2", "dep:base64"]
credential-vendor-gcp = ["dep:google-cloud-auth", "dep:reqwest", "dep:sha2", "dep:base64"]
credential-vendor-azure = ["dep:azure_core", "dep:azure_identity", "dep:azure_storage", "dep:azure_storage_blobs", "dep:time", "dep:sha2", "dep:base64", "dep:reqwest"]

[dependencies]
Expand Down Expand Up @@ -53,7 +53,7 @@ arrow-schema = { workspace = true }
axum = { workspace = true, optional = true }
tower = { workspace = true, optional = true }
tower-http = { workspace = true, optional = true, features = ["trace", "cors", "normalize-path"] }
serde = { workspace = true, optional = true }
serde = { workspace = true }

# Common dependencies
async-trait.workspace = true
Expand Down
25 changes: 25 additions & 0 deletions rust/lance-namespace-impls/src/json.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// SPDX-License-Identifier: Apache-2.0
// SPDX-FileCopyrightText: Copyright The Lance Authors

use lance_namespace::models::JsonArrowDataType;
use serde::{Deserialize, Serialize};

// TODO: remove this after https://github.com/lance-format/lance-namespace/pull/297 is merged
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct JsonPartitionField {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: since it's a part of the namespace spec, I think we can add this as a part of the OpenAPI definition, so it is codegened and has all the serde aspects handled automatically.

field_id: String,
source_ids: Vec<i32>,
transform: JsonTransform,
expression: String,
result_type: JsonArrowDataType,
}

#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct JsonTransform {
#[serde(rename = "type")]
r#type: String, // The transform type
#[serde(rename = "num_buckets", skip_serializing_if = "Option::is_none")]
num_buckets: Option<i32>, // Number of buckets N
#[serde(rename = "width", skip_serializing_if = "Option::is_none")]
width: Option<i32>, // Truncation width W
}
2 changes: 2 additions & 0 deletions rust/lance-namespace-impls/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,13 @@
pub mod credentials;
pub mod dir;

#[cfg(feature = "rest")]

Check warning on line 75 in rust/lance-namespace-impls/src/lib.rs

View workflow job for this annotation

GitHub Actions / format

Diff in /home/runner/work/lance/lance/rust/lance-namespace-impls/src/lib.rs
pub mod rest;

#[cfg(feature = "rest-adapter")]
pub mod rest_adapter;
pub mod partition;
pub mod json;

// Re-export connect builder
pub use connect::ConnectBuilder;
Expand Down
Loading
Loading