We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0966b08 commit c11641fCopy full SHA for c11641f
server/src/event/format.rs
@@ -42,6 +42,7 @@ pub trait EventFormat: Sized {
42
self,
43
schema: HashMap<String, Arc<Field>>,
44
time_partition: Option<String>,
45
+ static_schema_flag: Option<String>,
46
) -> Result<(Self::Data, EventSchema, bool, Tags, Metadata), AnyError>;
47
fn decode(data: Self::Data, schema: Arc<Schema>) -> Result<RecordBatch, AnyError>;
48
fn into_recordbatch(
@@ -50,8 +51,11 @@ pub trait EventFormat: Sized {
50
51
52
static_schema_flag: Option<String>,
53
) -> Result<(RecordBatch, bool), AnyError> {
- let (data, mut schema, is_first, tags, metadata) =
54
- self.to_data(storage_schema.clone(), time_partition)?;
+ let (data, mut schema, is_first, tags, metadata) = self.to_data(
55
+ storage_schema.clone(),
56
+ time_partition,
57
+ static_schema_flag.clone(),
58
+ )?;
59
60
if get_field(&schema, DEFAULT_TAGS_KEY).is_some() {
61
return Err(anyhow!("field {} is a reserved field", DEFAULT_TAGS_KEY));
server/src/event/format/json.rs
@@ -46,6 +46,7 @@ impl EventFormat for Event {
49
) -> Result<(Self::Data, Vec<Arc<Field>>, bool, Tags, Metadata), anyhow::Error> {
let data = flatten_json_body(self.data, time_partition)?;
let stream_schema = schema;
@@ -91,9 +92,10 @@ impl EventFormat for Event {
91
92
},
93
};
94
- if value_arr
95
- .iter()
96
- .any(|value| fields_mismatch(&schema, value))
+ if static_schema_flag.is_none()
+ && value_arr
97
+ .iter()
98
+ .any(|value| fields_mismatch(&schema, value))
99
{
100
return Err(anyhow!(
101
"Could not process this event due to mismatch in datatype"
0 commit comments