daniel-shields opened a new issue, #36385:
URL: https://github.com/apache/arrow/issues/36385

   ### Describe the bug, including details regarding any error messages, 
version, and platform.
   
   Parquet statistics appear to always return true for distinct value count 
even when it is not set.
   
   ```
   import os
   import sys
   import pyarrow as pa
   import pyarrow.parquet as pq
   print(f"{sys.version}")
   print(f"{pa.__version__=}")
   
   array = pa.array([0.0, 1.0], pa.float64())  # Two distinct values
   table = pa.table([array], names="x")
   path = os.path.expanduser("~/test.parquet")
   pq.write_table(table, path)
   with pq.ParquetFile(path) as file:
       has_distinct_count = 
file.metadata.row_group(0).column(0).statistics.has_distinct_count
       distinct_count = 
file.metadata.row_group(0).column(0).statistics.distinct_count
       print(f"{has_distinct_count=}, {distinct_count=}")
   ```
   
   output:
   ```
   3.9.12 (main, Jan  1 2020, 00:00:00) 
   [GCC 8.3.0]
   pa.__version__='12.0.0'
   has_distinct_count=True, distinct_count=0
   ```
   
   ### Component(s)
   
   Python


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