Skip to content

Commit d6116e8

Browse files
added validation for the custom partition fields in the log event (#837)
1 parent 055ef0d commit d6116e8

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

server/src/utils/json/flatten.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,9 @@ pub fn validate_custom_partition(
122122
.get(custom_partition_field.trim())
123123
.unwrap()
124124
.to_string();
125-
if custom_partition_value.is_empty() {
125+
if custom_partition_value.is_empty()
126+
|| custom_partition_value.eq_ignore_ascii_case("null")
127+
{
126128
return Err(anyhow!(format!(
127129
"ingestion failed as field {} is empty",
128130
custom_partition_field
@@ -155,7 +157,7 @@ pub fn validate_time_partition(
155157
30
156158
};
157159
let body_timestamp = value.get(&time_partition.clone().unwrap().to_string());
158-
if body_timestamp.is_some() {
160+
if body_timestamp.is_some() && body_timestamp.unwrap().to_owned().as_str().is_some() {
159161
if body_timestamp
160162
.unwrap()
161163
.to_owned()

0 commit comments

Comments
 (0)