pitrou commented on code in PR #40817:
URL: https://github.com/apache/arrow/pull/40817#discussion_r1541435469
##########
cpp/src/arrow/acero/partition_util.h:
##########
@@ -62,7 +62,7 @@ class PartitionSort {
template <class INPUT_PRTN_ID_FN, class OUTPUT_POS_FN>
static void Eval(int64_t num_rows, int num_prtns, uint16_t* prtn_ranges,
INPUT_PRTN_ID_FN prtn_id_impl, OUTPUT_POS_FN
output_pos_impl) {
- ARROW_DCHECK(num_rows > 0 && num_rows <= (1 << 15));
+ ARROW_DCHECK(num_rows > 0 && num_rows <= ((1 << 16) - 1));
Review Comment:
Can we avoid magic numbers? You can use `std::numeric_limits`.
##########
cpp/src/arrow/acero/partition_util.h:
##########
@@ -62,7 +62,7 @@ class PartitionSort {
template <class INPUT_PRTN_ID_FN, class OUTPUT_POS_FN>
static void Eval(int64_t num_rows, int num_prtns, uint16_t* prtn_ranges,
INPUT_PRTN_ID_FN prtn_id_impl, OUTPUT_POS_FN
output_pos_impl) {
- ARROW_DCHECK(num_rows > 0 && num_rows <= (1 << 15));
+ ARROW_DCHECK(num_rows > 0 && num_rows <= ((1 << 16) - 1));
ARROW_DCHECK(num_prtns >= 1 && num_prtns <= (1 << 15));
Review Comment:
Same here (why `1<<15`??).
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]