pitrou commented on code in PR #48717:
URL: https://github.com/apache/arrow/pull/48717#discussion_r2672659779


##########
cpp/src/parquet/statistics.cc:
##########
@@ -290,7 +296,26 @@ struct BinaryLikeCompareHelperBase {
 
 template <bool is_signed>
 struct CompareHelper<ByteArrayType, is_signed>
-    : public BinaryLikeCompareHelperBase<ByteArrayType, is_signed> {};
+    : public BinaryLikeCompareHelperBase<ByteArrayType, is_signed> {
+  using Base = BinaryLikeCompareHelperBase<ByteArrayType, is_signed>;
+  using T = ByteArray;
+
+  // Use kNoValueSentinel instead of nullptr to distinguish "no value" from 
empty string.

Review Comment:
   This is rather confusing, why not do the reverse? i.e. have nullptr mean a 
missing statistic, while a non-null empty string would mean an empty statistic.



##########
cpp/src/parquet/statistics.cc:
##########
@@ -290,7 +296,26 @@ struct BinaryLikeCompareHelperBase {
 
 template <bool is_signed>
 struct CompareHelper<ByteArrayType, is_signed>
-    : public BinaryLikeCompareHelperBase<ByteArrayType, is_signed> {};
+    : public BinaryLikeCompareHelperBase<ByteArrayType, is_signed> {
+  using Base = BinaryLikeCompareHelperBase<ByteArrayType, is_signed>;
+  using T = ByteArray;
+
+  // Use kNoValueSentinel instead of nullptr to distinguish "no value" from 
empty string.
+  static T DefaultMin() { return T{0, kNoValueSentinel}; }
+  static T DefaultMax() { return T{0, kNoValueSentinel}; }

Review Comment:
   I think these could just return `ByteArray("")` (or 
`ByteArray(std::string_view(""))` if that doesn't work?)



-- 
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]

Reply via email to