You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@druid.apache.org by "GabrielCWT (via GitHub)" <gi...@apache.org> on 2025/10/22 07:43:19 UTC

[PR] Validate that dynamic partition spec values are positive (druid)

GabrielCWT opened a new pull request, #18684:
URL: https://github.com/apache/druid/pull/18684

   Ensures that maxRowsPerSegment and maxTotalRows are either null or a positive value. 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org


Re: [PR] Validate that dynamic partition spec values are positive (druid)

Posted by "GabrielCWT (via GitHub)" <gi...@apache.org>.
GabrielCWT commented on code in PR #18684:
URL: https://github.com/apache/druid/pull/18684#discussion_r2453710351


##########
server/src/test/java/org/apache/druid/server/compaction/CompactionStatusTest.java:
##########
@@ -213,7 +213,7 @@ public void testStatusWhenLastCompactionStateIsEmpty()
   @Test
   public void testStatusOnPartitionsSpecMismatch()

Review Comment:
   I was thinking of adding tests for this as well. Should we create a new class `DynamicPartitionsSpecTest` instead? I think testing the constructor behavior in `CompactionStatusTest` is not a good idea



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org


Re: [PR] Validate that dynamic partition spec values are positive (druid)

Posted by "kfaraz (via GitHub)" <gi...@apache.org>.
kfaraz commented on code in PR #18684:
URL: https://github.com/apache/druid/pull/18684#discussion_r2452438407


##########
server/src/test/java/org/apache/druid/server/compaction/CompactionStatusTest.java:
##########
@@ -213,7 +213,7 @@ public void testStatusWhenLastCompactionStateIsEmpty()
   @Test
   public void testStatusOnPartitionsSpecMismatch()

Review Comment:
   We can probably add a test for negative/zero values.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org


Re: [PR] Validate that dynamic partition spec values are positive (druid)

Posted by "FrankChen021 (via GitHub)" <gi...@apache.org>.
FrankChen021 merged PR #18684:
URL: https://github.com/apache/druid/pull/18684


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org


Re: [PR] Validate that dynamic partition spec values are positive (druid)

Posted by "kfaraz (via GitHub)" <gi...@apache.org>.
kfaraz commented on code in PR #18684:
URL: https://github.com/apache/druid/pull/18684#discussion_r2450787885


##########
processing/src/main/java/org/apache/druid/indexer/partitions/DynamicPartitionsSpec.java:
##########
@@ -50,10 +50,13 @@ public DynamicPartitionsSpec(
       @JsonProperty("maxTotalRows") @Nullable Long maxTotalRows
   )
   {
-    this.maxRowsPerSegment = PartitionsSpec.isEffectivelyNull(maxRowsPerSegment)
+
+    this.maxRowsPerSegment = PartitionsSpec.isEffectivelyNull(maxRowsPerSegment) || maxRowsPerSegment <= 0

Review Comment:
   If the given value is negative, we should throw an `InvalidInput` exception rather than defaulting to some other value.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org


Re: [PR] Validate that dynamic partition spec values are positive (druid)

Posted by "GabrielCWT (via GitHub)" <gi...@apache.org>.
GabrielCWT commented on code in PR #18684:
URL: https://github.com/apache/druid/pull/18684#discussion_r2458392256


##########
server/src/test/java/org/apache/druid/server/compaction/CompactionStatusTest.java:
##########
@@ -213,7 +213,7 @@ public void testStatusWhenLastCompactionStateIsEmpty()
   @Test
   public void testStatusOnPartitionsSpecMismatch()

Review Comment:
   Just a follow up, I've created `DynamicPartitionsSpecTest` 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org