mirror of
https://github.com/lancedb/lancedb.git
synced 2026-10-19 02:02:27 +00:00
Merge main into gatekeeper/fix-4260-1
Preserve sliced child validity with Lance v14.0.0-beta.10 and its JSONB dependency.
This commit is contained in:
Vendored
+2
-2
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "lance-arrow"
|
||||
version = "14.0.0-beta.7"
|
||||
version = "14.0.0-beta.10"
|
||||
edition = "2024"
|
||||
authors = ["Lance Devs <dev@lance.org>"]
|
||||
license = "Apache-2.0"
|
||||
@@ -25,7 +25,7 @@ bytemuck = { version = "1", default-features = false, features = ["extern_crate_
|
||||
bytes.workspace = true
|
||||
futures.workspace = true
|
||||
half = { workspace = true, features = ["std", "bytemuck"] }
|
||||
jsonb = { version = "0.5.3", default-features = false, features = ["databend"] }
|
||||
lance-jsonb.workspace = true
|
||||
num-traits.workspace = true
|
||||
rand = { workspace = true, features = ["small_rng"] }
|
||||
|
||||
|
||||
+2
-2
@@ -1,5 +1,5 @@
|
||||
This directory contains `rust/lance-arrow` from Lance tag `v14.0.0-beta.7`
|
||||
(commit `0fd26effc79c62c244a5baf92cdda06e301baf21`), licensed under Apache-2.0.
|
||||
This directory contains `rust/lance-arrow` from Lance tag `v14.0.0-beta.10`
|
||||
(commit `fa3638fd816ab2ff9a2ecbba7e51465d8879958f`), licensed under Apache-2.0.
|
||||
|
||||
LanceDB carries a local fix in `src/lib.rs` for sliced child validity bitmaps
|
||||
until a Lance release includes the fix. The patch is selected in the root
|
||||
|
||||
+8
-8
@@ -14,8 +14,8 @@ use arrow_array::{
|
||||
LargeStringArray, ListArray, MapArray, OffsetSizeTrait, RecordBatch, StringArray, StructArray,
|
||||
};
|
||||
use arrow_schema::{ArrowError, DataType, Field as ArrowField, Fields, Schema};
|
||||
use jsonb::OwnedJsonb;
|
||||
use jsonb::jsonpath::{JsonPath, Selector};
|
||||
use lance_jsonb::OwnedJsonb;
|
||||
use lance_jsonb::jsonpath::{JsonPath, Selector};
|
||||
|
||||
use crate::ARROW_EXT_NAME_KEY;
|
||||
|
||||
@@ -336,19 +336,19 @@ impl TryFrom<ArrayRef> for JsonArray {
|
||||
|
||||
/// Encode JSON string to JSONB format
|
||||
pub fn encode_json(json_str: &str) -> Result<Vec<u8>, Box<dyn std::error::Error>> {
|
||||
let value = jsonb::parse_value(json_str.as_bytes())?;
|
||||
let value = lance_jsonb::parse_value(json_str.as_bytes())?;
|
||||
Ok(value.to_vec())
|
||||
}
|
||||
|
||||
/// Decode JSONB bytes to JSON string
|
||||
pub fn decode_json(jsonb_bytes: &[u8]) -> String {
|
||||
let raw_jsonb = jsonb::RawJsonb::new(jsonb_bytes);
|
||||
let raw_jsonb = lance_jsonb::RawJsonb::new(jsonb_bytes);
|
||||
raw_jsonb.to_string()
|
||||
}
|
||||
|
||||
/// Parse a JSONPath expression.
|
||||
pub fn parse_json_path(path: &str) -> Result<JsonPath<'_>, ArrowError> {
|
||||
jsonb::jsonpath::parse_json_path(path.as_bytes())
|
||||
lance_jsonb::jsonpath::parse_json_path(path.as_bytes())
|
||||
.map_err(|e| ArrowError::InvalidArgumentError(format!("Invalid JSONPath '{path}': {e}")))
|
||||
}
|
||||
|
||||
@@ -360,7 +360,7 @@ pub fn select_json_path(
|
||||
jsonb_bytes: &[u8],
|
||||
path: &JsonPath<'_>,
|
||||
) -> Result<Option<OwnedJsonb>, ArrowError> {
|
||||
Selector::new(jsonb::RawJsonb::new(jsonb_bytes))
|
||||
Selector::new(lance_jsonb::RawJsonb::new(jsonb_bytes))
|
||||
.select_value(path)
|
||||
.map_err(|e| {
|
||||
ArrowError::InvalidArgumentError(format!("Failed to select JSONPath {path}: {e}"))
|
||||
@@ -369,7 +369,7 @@ pub fn select_json_path(
|
||||
|
||||
/// Whether `path` matches any value in a JSONB value.
|
||||
pub fn json_path_exists(jsonb_bytes: &[u8], path: &JsonPath<'_>) -> Result<bool, ArrowError> {
|
||||
Selector::new(jsonb::RawJsonb::new(jsonb_bytes))
|
||||
Selector::new(lance_jsonb::RawJsonb::new(jsonb_bytes))
|
||||
.exists(path)
|
||||
.map_err(|e| {
|
||||
ArrowError::InvalidArgumentError(format!("Failed to match JSONPath {path}: {e}"))
|
||||
@@ -381,7 +381,7 @@ pub fn select_json_path_values(
|
||||
jsonb_bytes: &[u8],
|
||||
path: &JsonPath<'_>,
|
||||
) -> Result<Vec<OwnedJsonb>, ArrowError> {
|
||||
Selector::new(jsonb::RawJsonb::new(jsonb_bytes))
|
||||
Selector::new(lance_jsonb::RawJsonb::new(jsonb_bytes))
|
||||
.select_values(path)
|
||||
.map_err(|e| {
|
||||
ArrowError::InvalidArgumentError(format!("Failed to select JSONPath {path}: {e}"))
|
||||
|
||||
Reference in New Issue
Block a user