Skip to content

Commit

Permalink
fix: run fields_mismatch against static_schema data also (#1123)
Browse files Browse the repository at this point in the history
  • Loading branch information
de-sh authored Jan 23, 2025
1 parent 02e2007 commit 5286782
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 5 deletions.
4 changes: 1 addition & 3 deletions src/event/format/json.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ impl EventFormat for Event {
fn to_data(
self,
schema: &HashMap<String, Arc<Field>>,
static_schema_flag: bool,
time_partition: Option<&String>,
schema_version: SchemaVersion,
) -> Result<(Self::Data, Vec<Arc<Field>>, bool), anyhow::Error> {
Expand Down Expand Up @@ -94,8 +93,7 @@ impl EventFormat for Event {
}
};

if !static_schema_flag
&& value_arr
if value_arr
.iter()
.any(|value| fields_mismatch(&schema, value, schema_version))
{
Expand Down
2 changes: 0 additions & 2 deletions src/event/format/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,6 @@ pub trait EventFormat: Sized {
fn to_data(
self,
schema: &HashMap<String, Arc<Field>>,
static_schema_flag: bool,
time_partition: Option<&String>,
schema_version: SchemaVersion,
) -> Result<(Self::Data, EventSchema, bool), AnyError>;
Expand All @@ -115,7 +114,6 @@ pub trait EventFormat: Sized {
) -> Result<(RecordBatch, bool), AnyError> {
let (data, mut schema, is_first) = self.to_data(
storage_schema,
static_schema_flag,
time_partition,
schema_version,
)?;
Expand Down

0 comments on commit 5286782

Please sign in to comment.