[datafusion] Support Utf8View schemas and residual filtering#543
Conversation
|
I found two blockers in the current revision (
The focused residual-filter, DataFusion schema, zero-column projection, and TPC-DS tests pass locally; I did not find another wrong-read in those implementation paths. |
|
There is still one Python compatibility path that is not covered by the current fix (
I reproduced it locally against this head with PyArrow 23.0.1 and DataFusion 54.0.0: internal = SQLContext()
internal.register_catalog("paimon", {"warehouse": warehouse})
internal.sql("CREATE TABLE paimon.default.t (id INT, name STRING)")
internal.sql("INSERT INTO paimon.default.t VALUES (2, 'b'), (1, 'a')")
external = datafusion.SessionContext()
external.register_catalog_provider(
"paimon", PaimonCatalog({"warehouse": warehouse})
)
table = pa.Table.from_batches(
external.sql("SELECT id, name FROM paimon.default.t").collect()
)The bundled and Please also preserve compatible |
leaves12138
left a comment
There was a problem hiding this comment.
Re-reviewed the latest revision. The external Python catalog-provider path now preserves Utf8 schemas, and the new regression test covers SessionContext.register_catalog_provider together with PyArrow sort_by. I also verified the String primary-key merge test locally. All CI checks pass. LGTM.
What changed
CHAR/VARCHARcolumns to DataFusion asUtf8ViewWhy
The TPC-DS benchmark uncovered a mismatch between the schema advertised to DataFusion and the physical string arrays returned by Paimon scans. String residual predicates also constructed
Utf8scalars even when the decoded column usedUtf8View, causing Arrow comparison kernels to reject otherwise valid predicates.This PR keeps the compatibility change self-contained. Runtime-filter, pruning, statistics, and reader batch-size work remain in later PRs.
Validation
cargo check -p paimon -p paimon-datafusion -p paimon-tpcds-benchcargo test -p paimon test_evaluate_string_view_comparison_familiescargo test -p paimon-datafusion --lib test_datafusion_schema_hides_paimon_field_idscargo test -p paimon-datafusion --test pk_tables test_pk_aggregation_count_star_empty_projection -- --exactcargo test -p paimon-tpcds-benchcargo clippy -p paimon -p paimon-datafusion -p paimon-tpcds-bench --all-targets -- -D warningscargo fmt --all -- --checkA local full
paimon-datafusion --librun passed 278 tests; seven existing fixture-dependent tests reportedTableNotExistbecause the external/tmp/paimon-warehousetables were not populated.