File tree Expand file tree Collapse file tree 2 files changed +22
-0
lines changed Expand file tree Collapse file tree 2 files changed +22
-0
lines changed Original file line number Diff line number Diff line change 1717
1818module Arrow
1919 class ArrayStatistics
20+ if method_defined? ( :null_count_exact )
21+ alias_method :null_count_raw , :null_count
22+ def null_count
23+ return nil unless has_null_count?
24+ if null_count_exact?
25+ null_count_exact
26+ else
27+ null_count_approximate
28+ end
29+ end
30+ end
31+
2032 if method_defined? ( :distinct_count_exact )
2133 alias_method :distinct_count_raw , :distinct_count
2234 def distinct_count
Original file line number Diff line number Diff line change @@ -27,6 +27,16 @@ def setup
2727 @statistics = loaded_table [ :int64 ] . data . chunks [ 0 ] . statistics
2828 end
2929
30+ def test_null_count
31+ assert do
32+ @statistics . has_null_count?
33+ end
34+ assert do
35+ @statistics . null_count_exact?
36+ end
37+ assert_equal ( 1 , @statistics . null_count )
38+ end
39+
3040 def test_distinct_count
3141 assert do
3242 not @statistics . has_distinct_count?
You can’t perform that action at this time.
0 commit comments