File tree Expand file tree Collapse file tree 1 file changed +13
-7
lines changed Expand file tree Collapse file tree 1 file changed +13
-7
lines changed Original file line number Diff line number Diff line change @@ -557,17 +557,23 @@ impl Parseable {
557
557
. await ;
558
558
}
559
559
560
- if !time_partition. is_empty ( ) || !time_partition_limit. is_empty ( ) {
561
- return Err ( StreamError :: Custom {
562
- msg : "Creating stream with time partition is not supported anymore" . to_string ( ) ,
563
- status : StatusCode :: BAD_REQUEST ,
564
- } ) ;
565
- }
560
+ let time_partition_in_days = if !time_partition_limit. is_empty ( ) {
561
+ Some ( validate_time_partition_limit ( & time_partition_limit) ?)
562
+ } else {
563
+ None
564
+ } ;
566
565
567
566
if let Some ( custom_partition) = & custom_partition {
568
567
validate_custom_partition ( custom_partition) ?;
569
568
}
570
569
570
+ if !time_partition. is_empty ( ) && custom_partition. is_some ( ) {
571
+ return Err ( StreamError :: Custom {
572
+ msg : "Cannot set both time partition and custom partition" . to_string ( ) ,
573
+ status : StatusCode :: BAD_REQUEST ,
574
+ } ) ;
575
+ }
576
+
571
577
let schema = validate_static_schema (
572
578
body,
573
579
stream_name,
@@ -579,7 +585,7 @@ impl Parseable {
579
585
self . create_stream (
580
586
stream_name. to_string ( ) ,
581
587
& time_partition,
582
- None ,
588
+ time_partition_in_days ,
583
589
custom_partition. as_ref ( ) ,
584
590
static_schema_flag,
585
591
schema,
You can’t perform that action at this time.
0 commit comments