feat: add greptime's arrow json extension type (#7168)

* feat: add arrow json extension type

* feat: add json structure settings to extension type

* refactor: store json structure settings as extension metadata

* chore: make binary an acceptable type for extension
This commit is contained in:
Ning Sun
2025-11-06 02:34:57 +08:00
committed by GitHub
parent 0939dc1d32
commit fb92e4d0b2
11 changed files with 204 additions and 25 deletions

View File

@@ -16,7 +16,9 @@
use std::collections::HashMap;
use arrow_schema::extension::ExtensionType;
use common_meta::SchemaOptions;
use datatypes::extension::json::JsonExtensionType;
use datatypes::schema::{
COLUMN_FULLTEXT_OPT_KEY_ANALYZER, COLUMN_FULLTEXT_OPT_KEY_BACKEND,
COLUMN_FULLTEXT_OPT_KEY_CASE_SENSITIVE, COLUMN_FULLTEXT_OPT_KEY_FALSE_POSITIVE_RATE,
@@ -159,7 +161,12 @@ fn create_column(column_schema: &ColumnSchema, quote_style: char) -> Result<Colu
extensions.inverted_index_options = Some(HashMap::new().into());
}
if let Some(settings) = column_schema.json_structure_settings()? {
if let Some(json_extension) = column_schema.extension_type::<JsonExtensionType>()? {
let settings = json_extension
.metadata()
.json_structure_settings
.clone()
.unwrap_or_default();
extensions.set_json_structure_settings(settings);
}