Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 7 additions & 13 deletions src/parseable/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -451,23 +451,17 @@ 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 let Some(custom_partition) = &custom_partition {
validate_custom_partition(custom_partition)?;
}

if !time_partition.is_empty() && custom_partition.is_some() {
if !time_partition.is_empty() || !time_partition_limit.is_empty() {
return Err(StreamError::Custom {
msg: "Cannot set both time partition and custom partition".to_string(),
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)?;
}

let schema = validate_static_schema(
body,
stream_name,
Expand All @@ -479,7 +473,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,
Expand Down
Loading