feat: add support crc32 expression#3498
Conversation
|
Thanks for adding crc32 support @rafafrdz! I think use datafusion_spark::function::hash::crc32::SparkCrc32;
// ...
session_ctx.register_udf(ScalarUDF::new_from_impl(SparkCrc32::default()));For the tests, Comet now has a SQL file-based testing framework (CometSqlFileTestSuite) that's preferred for expression tests. Could you add |
Tests currently fail because the function isn't registered, as expected. @rafafrdz how did you test this locally? |
…dd-support-crc32 # Conflicts: # native/core/src/execution/jni_api.rs
52d95d7 to
29d9250
Compare
|
@andygrove Sorry I missed push the commit where I register the udf... 😅
for example: ./mvnw test -Dsuites="org.apache.comet.CometSqlFileTestSuite crc32" -Pspark-4.0 -Pscala-2.13 and changing the java version: Please, let me know if I'm missing something or doing something wrong. And apologize for the inconveniences |
There was a problem hiding this comment.
Should there also be a test for crc32(col)?
Co-authored-by: Andy Grove <agrove@apache.org>
…t/add-support-crc32 # Conflicts: # spark/src/test/resources/sql-tests/expressions/hash/crc32.sql
There was a problem hiding this comment.
This issue is for sha2. Is there a separate issue for crc32 with literal arguments that should be linked to here?
What happens if you remove the ignore from this test?
There was a problem hiding this comment.
sorry @andygrove my mistake. It was copy-paste. I deleted it and it still pass the sql test file
Summary
crc32by mappingCrc32to the native scalar functioncrc32in expression serde.CometExpressionSuiteto includecrc32on string and casted numeric inputs.crc32as supported.Why
This closes one of the missing DataFusion 50 migration functions from issue #2443 and reduces fallback to Spark for crc32 queries.
Part of #2443 and #240