Commit d65fb86
authored
Remove unnecessary bit counting code from spark
## Which issue does this PR close?
- Followup to #18225 and PR #18322
## Rationale for this change
Spark's `bit_count` function always operators on 64-bit values, while
the original `bit_count` implementation in `datafusion_spark` operated
on the native size of the input value.
In order to fix this a custom bit counting implementation was ported
over from the Java Spark implementation. This isn't really necessary
though. Widening signed integers to `i64` and then using
`i64::count_ones` will get you the exact same result and is less
obscure.
## What changes are included in this PR?
Remove custom `bitcount` logic and use `i64::count_ones` instead.
## Are these changes tested?
Covered by existing tests that were added for #18225
## Are there any user-facing changes?
Nobit_count (#18841)1 parent 195bd5c commit d65fb86
1 file changed
+6
-19
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
102 | 102 | | |
103 | 103 | | |
104 | 104 | | |
105 | | - | |
| 105 | + | |
106 | 106 | | |
107 | 107 | | |
108 | 108 | | |
109 | 109 | | |
110 | 110 | | |
111 | | - | |
| 111 | + | |
112 | 112 | | |
113 | 113 | | |
114 | 114 | | |
115 | 115 | | |
116 | 116 | | |
117 | | - | |
| 117 | + | |
118 | 118 | | |
119 | 119 | | |
120 | 120 | | |
121 | | - | |
122 | | - | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
123 | 124 | | |
124 | 125 | | |
125 | 126 | | |
| |||
155 | 156 | | |
156 | 157 | | |
157 | 158 | | |
158 | | - | |
159 | | - | |
160 | | - | |
161 | | - | |
162 | | - | |
163 | | - | |
164 | | - | |
165 | | - | |
166 | | - | |
167 | | - | |
168 | | - | |
169 | | - | |
170 | | - | |
171 | | - | |
172 | 159 | | |
173 | 160 | | |
174 | 161 | | |
| |||
0 commit comments