You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "jorisvandenbossche (via GitHub)" <gi...@apache.org> on 2023/05/10 11:35:38 UTC

[GitHub] [arrow] jorisvandenbossche commented on pull request #35522: GH-35521: [C++] Hash null bitmap only if null count is 0

jorisvandenbossche commented on PR #35522:
URL: https://github.com/apache/arrow/pull/35522#issuecomment-1542036825

   @pitrou small example using python (you don't actually need to filter or slice yourself, since a scalar is already a slice into its parent array):
   
   ```
   In [31]: arr1 = pa.array([[0, 1], [2, 3]])
   
   In [32]: scalar1 = arr1[0]
   
   In [33]: arr2 = pa.array([[0, 1], [2, None]])
   
   In [34]: scalar2 = arr2[0]
   
   In [35]: scalar1
   Out[35]: <pyarrow.ListScalar: [0, 1]>
   
   In [36]: scalar2
   Out[36]: <pyarrow.ListScalar: [0, 1]>
   
   In [37]: hash(scalar1)
   Out[37]: 6972737373264176731
   
   In [38]: hash(scalar2)
   Out[38]: 5286180417804377197
   
   In [39]: scalar1.values.buffers()
   Out[39]: 
   [None,
    <pyarrow.Buffer address=0x7fbc56a08200 size=32 is_cpu=True is_mutable=True>]
   
   In [40]: scalar2.values.buffers()
   Out[40]: 
   [<pyarrow.Buffer address=0x7fbc56a08180 size=1 is_cpu=True is_mutable=True>,
    <pyarrow.Buffer address=0x7fbc56a08280 size=32 is_cpu=True is_mutable=True>]
   ```
   
   Those two scalars are equal, so should have the same hash. But the one has a validity bitmap, and the other not.


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org