You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@druid.apache.org by GitBox <gi...@apache.org> on 2022/09/20 21:35:12 UTC
[GitHub] [druid] rash67 commented on a diff in pull request #13102: Add BIG_SUM SQL function
rash67 commented on code in PR #13102:
URL: https://github.com/apache/druid/pull/13102#discussion_r975834440
##########
extensions-contrib/compressed-bigdecimal/src/main/java/org/apache/druid/compressedbigdecimal/CompressedBigDecimalAggregatorFactory.java:
##########
@@ -65,19 +69,23 @@
* @param fieldName fieldName metric field name
* @param size size of the int array used for calculations
* @param scale scale of the number
+ * @param strictNumberParsing if true, failure to parse strings to numbers throws an exception. otherwise 0 is
+ * returned
*/
@JsonCreator
public CompressedBigDecimalAggregatorFactory(
@JsonProperty("name") String name,
@JsonProperty("fieldName") String fieldName,
@JsonProperty(value = "size", required = false) Integer size,
- @JsonProperty(value = "scale", required = false) Integer scale
+ @JsonProperty(value = "scale", required = false) Integer scale,
+ @JsonProperty(value = "strictNumberParsing", required = false) Boolean strictNumberParsing
)
{
this.name = name;
this.fieldName = fieldName;
this.size = size == null ? DEFAULT_SIZE : size;
this.scale = scale == null ? DEFAULT_SCALE : scale;
+ this.strictNumberParsing = strictNumberParsing != null && strictNumberParsing;
Review Comment:
hmm, everything else has defaults set in the SqlAggregator. The only reason I double-checked it here was because the JsonCreator requires Objects
the scale and size are also both nullable and I could pass in null for those. it seems like I should be consistent with the parameters. Other SqlAggregators do add defaults, so do it in both locations or just the constructor?
--
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