otegami commented on code in PR #46894:
URL: https://github.com/apache/arrow/pull/46894#discussion_r2166172891


##########
c_glib/arrow-glib/basic-array.cpp:
##########
@@ -476,6 +476,59 @@ 
garrow_array_statistics_get_null_count(GArrowArrayStatistics *statistics)
   }
 }
 
+/**
+ * garrow_array_statistics_has_distinct_count:
+ * @statistics: A #GArrowArrayStatistics.
+ *
+ * Returns: %TRUE if the distinct count is available, %FALSE otherwise.
+ *
+ * Since: 21.0.0
+ */
+gboolean
+garrow_array_statistics_has_distinct_count(GArrowArrayStatistics *statistics)
+{
+  auto priv = GARROW_ARRAY_STATISTICS_GET_PRIVATE(statistics);
+  return priv->statistics.distinct_count.has_value();
+}
+
+/**
+ * garrow_array_statistics_get_distinct_count:
+ * @statistics: A #GArrowArrayStatistics.
+ *
+ * Returns: 0 or larger value if @statistics has a valid distinct count value,
+ *   -1 otherwise.
+ *
+ * Since: 21.0.0
+ */
+gint64
+garrow_array_statistics_get_distinct_count(GArrowArrayStatistics *statistics)
+{
+  auto priv = GARROW_ARRAY_STATISTICS_GET_PRIVATE(statistics);
+  const auto &distinct_count = priv->statistics.distinct_count;
+  if (distinct_count) {
+    return distinct_count.value();
+  } else {
+    return -1;
+  }
+}
+
+/**
+ * garrow_array_statistics_set_distinct_count:
+ * @statistics: A #GArrowArrayStatistics.
+ * @distinct_count: The distinct count value to set.
+ *
+ * Sets the distinct count for the array statistics.
+ *
+ * Since: 21.0.0
+ */
+void
+garrow_array_statistics_set_distinct_count(GArrowArrayStatistics *statistics,
+                                           gint64 distinct_count)
+{
+  auto priv = GARROW_ARRAY_STATISTICS_GET_PRIVATE(statistics);
+  priv->statistics.distinct_count = distinct_count;
+}

Review Comment:
   fix: 
[0a2c22c](https://github.com/apache/arrow/pull/46894/commits/0a2c22c9ce6ea374058c61df87991dc71a272446)
 Sure.



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