mirror of
https://github.com/GreptimeTeam/greptimedb.git
synced 2026-01-13 16:52:56 +00:00
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:
@@ -32,10 +32,13 @@ pub mod tql;
|
||||
pub(crate) mod transform;
|
||||
pub mod truncate;
|
||||
|
||||
use std::sync::Arc;
|
||||
|
||||
use api::helper::ColumnDataTypeWrapper;
|
||||
use api::v1::SemanticType;
|
||||
use common_sql::default_constraint::parse_column_default_constraint;
|
||||
use common_time::timezone::Timezone;
|
||||
use datatypes::extension::json::{JsonExtensionType, JsonMetadata};
|
||||
use datatypes::prelude::ConcreteDataType;
|
||||
use datatypes::schema::{COMMENT_KEY, ColumnDefaultConstraint, ColumnSchema};
|
||||
use datatypes::types::TimestampType;
|
||||
@@ -149,8 +152,11 @@ pub fn column_to_schema(
|
||||
.extensions
|
||||
.build_json_structure_settings()?
|
||||
.unwrap_or_default();
|
||||
let extension = JsonExtensionType::new(Arc::new(JsonMetadata {
|
||||
json_structure_settings: Some(settings.clone()),
|
||||
}));
|
||||
column_schema
|
||||
.with_json_structure_settings(&settings)
|
||||
.with_extension_type(&extension)
|
||||
.with_context(|_| SetJsonStructureSettingsSnafu {
|
||||
value: format!("{settings:?}"),
|
||||
})?;
|
||||
|
||||
Reference in New Issue
Block a user