Skip to content

Commit 10aef7b

Browse files
update: remove time partition stream creation (#1227)
error if user tries to create a stream with a time partition updating time partition limit is still allowed for older streams
1 parent 7596825 commit 10aef7b

File tree

1 file changed

+7
-13
lines changed

1 file changed

+7
-13
lines changed

src/parseable/mod.rs

+7-13
Original file line numberDiff line numberDiff line change
@@ -451,23 +451,17 @@ impl Parseable {
451451
.await;
452452
}
453453

454-
let time_partition_in_days = if !time_partition_limit.is_empty() {
455-
Some(validate_time_partition_limit(&time_partition_limit)?)
456-
} else {
457-
None
458-
};
459-
460-
if let Some(custom_partition) = &custom_partition {
461-
validate_custom_partition(custom_partition)?;
462-
}
463-
464-
if !time_partition.is_empty() && custom_partition.is_some() {
454+
if !time_partition.is_empty() || !time_partition_limit.is_empty() {
465455
return Err(StreamError::Custom {
466-
msg: "Cannot set both time partition and custom partition".to_string(),
456+
msg: "Creating stream with time partition is not supported anymore".to_string(),
467457
status: StatusCode::BAD_REQUEST,
468458
});
469459
}
470460

461+
if let Some(custom_partition) = &custom_partition {
462+
validate_custom_partition(custom_partition)?;
463+
}
464+
471465
let schema = validate_static_schema(
472466
body,
473467
stream_name,
@@ -479,7 +473,7 @@ impl Parseable {
479473
self.create_stream(
480474
stream_name.to_string(),
481475
&time_partition,
482-
time_partition_in_days,
476+
None,
483477
custom_partition.as_ref(),
484478
static_schema_flag,
485479
schema,

0 commit comments

Comments
 (0)