Skip to content

Commit

Permalink
refactor: add ARROW_EXT_TYPE_INTERVAL
Browse files Browse the repository at this point in the history
  • Loading branch information
TCeason committed Dec 6, 2024
1 parent 4fa3689 commit 01274e3
Show file tree
Hide file tree
Showing 4 changed files with 205 additions and 109 deletions.
9 changes: 1 addition & 8 deletions bindings/nodejs/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -278,15 +278,8 @@ impl<'v> ToNapiValue for Value<'v> {
}
}
databend_driver::Value::Geometry(s) => String::to_napi_value(env, s.to_string()),
databend_driver::Value::Interval(s) => String::to_napi_value(env, s.to_string()),
databend_driver::Value::Geography(s) => String::to_napi_value(env, s.to_string()),
databend_driver::Value::Interval(i) => {
let interval = databend_driver::Interval {
months: i.0,
days: i.1,
nanos: i.2,
};
String::to_napi_value(env, interval.to_string())
}
}
}
}
Expand Down
9 changes: 1 addition & 8 deletions bindings/python/src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -102,14 +102,7 @@ impl<'py> IntoPyObject<'py> for Value {
databend_driver::Value::Variant(s) => s.into_bound_py_any(py)?,
databend_driver::Value::Geometry(s) => s.into_bound_py_any(py)?,
databend_driver::Value::Geography(s) => s.into_bound_py_any(py)?,
databend_driver::Value::Interval(i) => {
let interval = databend_driver::Interval {
months: i.0,
days: i.1,
nanos: i.2,
};
interval.to_string().into_bound_py_any(py)?
}
databend_driver::Value::Interval(s) => s.into_bound_py_any(py)?,
};
Ok(val)
}
Expand Down
2 changes: 2 additions & 0 deletions sql/src/schema.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ pub(crate) const ARROW_EXT_TYPE_BITMAP: &str = "Bitmap";
pub(crate) const ARROW_EXT_TYPE_GEOMETRY: &str = "Geometry";
#[cfg(feature = "flight-sql")]
pub(crate) const ARROW_EXT_TYPE_GEOGRAPHY: &str = "Geography";
#[cfg(feature = "flight-sql")]
pub(crate) const ARROW_EXT_TYPE_INTERVAL: &str = "Interval";

use databend_client::SchemaField as APISchemaField;

Expand Down
Loading

0 comments on commit 01274e3

Please sign in to comment.