mirror of
https://github.com/GreptimeTeam/greptimedb.git
synced 2026-09-11 07:52:16 +00:00
feat(json2): type hint (#8247)
* feat(json2): type hint * test(datatypes): add JsonSettings serde round-trip test * minor refactor This reverts commit 7ff5a5249a09be5396536284fe822b5761ef4e6a. * fix: code review
This commit is contained in:
@@ -309,11 +309,11 @@ pub(crate) fn parse_string_to_value(
|
||||
JsonFormat::Json2(_) => {
|
||||
let extension_type: Option<JsonExtensionType> =
|
||||
column_schema.extension_type().context(DatatypeSnafu)?;
|
||||
let json_structure_settings = extension_type
|
||||
.and_then(|x| x.metadata().json_structure_settings.clone())
|
||||
let json_settings = extension_type
|
||||
.and_then(|x| x.metadata().json_settings.clone())
|
||||
.unwrap_or_default();
|
||||
let v = serde_json::from_str(&s).context(DeserializeSnafu { json: s })?;
|
||||
json_structure_settings.encode(v).context(DatatypeSnafu)
|
||||
json_settings.encode(v).context(DatatypeSnafu)
|
||||
}
|
||||
},
|
||||
ConcreteDataType::Vector(d) => {
|
||||
|
||||
Reference in New Issue
Block a user