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

add support for f64 for concat fields #5369

Merged
merged 3 commits into from
Aug 30, 2024
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,10 @@ impl LeafType {
let val = u64::from_json_to_self(&json_val, numeric_options.coerce)?;
Ok(OneOrIter::one((val).into()))
}
LeafType::F64(_) => Err("unsupported concat type: f64".to_string()),
LeafType::F64(numeric_options) => {
let val = f64::from_json_to_self(&json_val, numeric_options.coerce)?;
Ok(OneOrIter::one((val).into()))
}
LeafType::Bool(_) => {
if let JsonValue::Bool(val) = json_val {
Ok(OneOrIter::one((val).into()))
Expand All @@ -294,9 +297,7 @@ impl LeafType {
LeafType::DateTime(_date_time_options) => {
Err("unsupported concat type: DateTime".to_string())
}
LeafType::Bytes(_binary_options) => {
Err("unsupported concat type: DateTime".to_string())
}
LeafType::Bytes(_binary_options) => Err("unsupported concat type: Bytes".to_string()),
LeafType::Json(_) => {
if let JsonValue::Object(json_obj) = json_val {
Ok(OneOrIter::Iter(
Expand All @@ -314,14 +315,13 @@ impl LeafType {

fn supported_for_concat(&self) -> bool {
use LeafType::*;
matches!(self, Text(_) | U64(_) | I64(_) | Bool(_) | Json(_))
matches!(self, Text(_) | U64(_) | I64(_) | F64(_) | Bool(_) | Json(_))
/*
// will be supported if possible
DateTime(_),
// Since concat is a JSON field, anything that JSON supports can be supported
DateTime(_), // Could be supported if the date is converted to Rfc3339
IpAddr(_),
// won't be supported
Bytes(_),
F64(_),
*/
}
}
Expand Down
Loading