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 |
| query | ||
| SELECT crc32(cast(a as string)), crc32(cast(b as string)) FROM test | ||
|
|
||
| -- literal arguments query ignore(https://github.com/apache/datafusion-comet/issues/3340) |
There was a problem hiding this comment.
It looks like a newline is missing here?
| -- literal arguments query ignore(https://github.com/apache/datafusion-comet/issues/3340) | |
| -- literal arguments | |
| query ignore(https://github.com/apache/datafusion-comet/issues/3340) |
| INSERT INTO test VALUES ('Spark SQL ', 10, 1.2), (NULL, NULL, NULL), ('', 0, 0.0), ('苹果手机', NULL, 3.999999), ('Spark SQL ', 10, 1.2), (NULL, NULL, NULL), ('', 0, 0.0), ('苹果手机', NULL, 3.999999) | ||
|
|
||
| query | ||
| SELECT crc32(cast(a as string)), crc32(cast(b as string)) FROM test |
There was a problem hiding this comment.
Should there also be a test for crc32(col)?
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