Commit 5b13315
Restore legacy SQL hash function names as aliases
Critical fix:
- HashFunctions.java: when this branch added @ScalarFunction(names =
{"murmur2", ...}) on existing public byte[]-overload hash functions
(murmurHash2, fnv1Hash32, fnv1aHash32, fnv1Hash64, fnv1aHash64), the
explicit names array overrode the auto-derived canonical name —
silently breaking existing user SQL queries / ingestion transforms /
views that called these functions on byte[] inputs by their original
names. Add the legacy camelCase names alongside the new short aliases
so both resolve to the same method:
@ScalarFunction(names = {"murmur2", "murmurHash2"})
@ScalarFunction(names = {"fnv1_32", "fnv1Hash32"})
@ScalarFunction(names = {"fnv1a_32", "fnv1aHash32"})
@ScalarFunction(names = {"fnv1_64", "fnv1Hash64"})
@ScalarFunction(names = {"fnv1a_64", "fnv1aHash64"})
(murmur3Bit32Default is a new 1-arg method introduced by this branch
with no upstream auto-derived name to preserve, so its single
"murmur3_32" alias is fine.)
- HashFunctionsTest: add testLegacyAndNewHashFunctionAliasesBothResolve
asserting both the legacy and new alias resolve via FunctionRegistry
to the same method, locking the contract so a future name reshuffle
cannot silently regress backward compatibility.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>1 parent c56a353 commit 5b13315
2 files changed
Lines changed: 44 additions & 5 deletions
File tree
- pinot-common/src
- main/java/org/apache/pinot/common/function/scalar
- test/java/org/apache/pinot/common/function/scalar
Lines changed: 11 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
122 | 122 | | |
123 | 123 | | |
124 | 124 | | |
125 | | - | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
126 | 128 | | |
127 | 129 | | |
128 | 130 | | |
| |||
240 | 242 | | |
241 | 243 | | |
242 | 244 | | |
243 | | - | |
| 245 | + | |
| 246 | + | |
244 | 247 | | |
245 | 248 | | |
246 | 249 | | |
| |||
262 | 265 | | |
263 | 266 | | |
264 | 267 | | |
265 | | - | |
| 268 | + | |
| 269 | + | |
266 | 270 | | |
267 | 271 | | |
268 | 272 | | |
| |||
284 | 288 | | |
285 | 289 | | |
286 | 290 | | |
287 | | - | |
| 291 | + | |
| 292 | + | |
288 | 293 | | |
289 | 294 | | |
290 | 295 | | |
| |||
306 | 311 | | |
307 | 312 | | |
308 | 313 | | |
309 | | - | |
| 314 | + | |
| 315 | + | |
310 | 316 | | |
311 | 317 | | |
312 | 318 | | |
| |||
Lines changed: 33 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| 22 | + | |
| 23 | + | |
22 | 24 | | |
23 | 25 | | |
24 | 26 | | |
25 | 27 | | |
| 28 | + | |
26 | 29 | | |
27 | 30 | | |
28 | 31 | | |
| |||
225 | 228 | | |
226 | 229 | | |
227 | 230 | | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
228 | 261 | | |
0 commit comments