From 533d9d2b9681d2ccb0888275def8ca4a1468beaf Mon Sep 17 00:00:00 2001 From: Nikhil Sinha Date: Fri, 7 Mar 2025 02:30:56 -0500 Subject: [PATCH 1/2] update: remove time partition stream creation gives error if user tries to create a stream with a time partition updating time partition limit is still allowed for older streams --- src/parseable/mod.rs | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/parseable/mod.rs b/src/parseable/mod.rs index 6e4f55e94..ac8504672 100644 --- a/src/parseable/mod.rs +++ b/src/parseable/mod.rs @@ -451,11 +451,12 @@ impl Parseable { .await; } - let time_partition_in_days = if !time_partition_limit.is_empty() { - Some(validate_time_partition_limit(&time_partition_limit)?) - } else { - None - }; + if !time_partition.is_empty() || !time_partition_limit.is_empty() { + return Err(StreamError::Custom { + msg: "Creating stream with time partition is not supported anymore".to_string(), + status: StatusCode::BAD_REQUEST, + }); + } if let Some(custom_partition) = &custom_partition { validate_custom_partition(custom_partition)?; @@ -479,7 +480,7 @@ impl Parseable { self.create_stream( stream_name.to_string(), &time_partition, - time_partition_in_days, + None, custom_partition.as_ref(), static_schema_flag, schema, From 181d18924c5cf20d7b6f8963529b9ccf0195431c Mon Sep 17 00:00:00 2001 From: Nikhil Sinha Date: Fri, 7 Mar 2025 03:40:05 -0500 Subject: [PATCH 2/2] removed redundant check --- src/parseable/mod.rs | 7 ------- 1 file changed, 7 deletions(-) diff --git a/src/parseable/mod.rs b/src/parseable/mod.rs index ac8504672..509125491 100644 --- a/src/parseable/mod.rs +++ b/src/parseable/mod.rs @@ -462,13 +462,6 @@ impl Parseable { validate_custom_partition(custom_partition)?; } - if !time_partition.is_empty() && custom_partition.is_some() { - return Err(StreamError::Custom { - msg: "Cannot set both time partition and custom partition".to_string(), - status: StatusCode::BAD_REQUEST, - }); - } - let schema = validate_static_schema( body, stream_name,