-
Notifications
You must be signed in to change notification settings - Fork 1.8k
fix: deserialization error for FilterExec (predicates with inlist)
#17224
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
0eec20d
reproduce for deserialization inlist
haohuaijin cf4f805
Merge branch 'main' into inlist-deser-error
haohuaijin fc5b988
fix: inlist deser error
haohuaijin 65192ca
Merge branch 'main' into inlist-deser-error
haohuaijin ff123b9
Merge branch 'main' into inlist-deser-error
haohuaijin 669fd59
Merge branch 'main' into inlist-deser-error
haohuaijin 1bb7b88
Merge remote-tracking branch 'apache/main' into inlist-deser-error
alamb File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2057,6 +2057,39 @@ async fn test_round_trip_date_part_display() -> Result<()> { | |
| Ok(()) | ||
| } | ||
|
|
||
| #[tokio::test] | ||
| async fn test_tpch_part_in_list_query_with_real_parquet_data() -> Result<()> { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I verified this test covers the code as it fails without the fix |
||
| use datafusion_common::test_util::datafusion_test_data; | ||
|
|
||
| let ctx = SessionContext::new(); | ||
|
|
||
| // Register the TPC-H part table using the local test data | ||
| let test_data = datafusion_test_data(); | ||
| let table_sql = format!( | ||
| "CREATE EXTERNAL TABLE part STORED AS PARQUET LOCATION '{test_data}/tpch_part_small.parquet'" | ||
| ); | ||
| ctx.sql(&table_sql).await.map_err(|e| { | ||
| DataFusionError::External(format!("Failed to create part table: {e}").into()) | ||
| })?; | ||
|
|
||
| // Test the exact problematic query | ||
| let sql = | ||
| "SELECT p_size FROM part WHERE p_size IN (14, 6, 5, 31) and p_partkey > 1000"; | ||
|
|
||
| let logical_plan = ctx.sql(sql).await?.into_unoptimized_plan(); | ||
| let optimized_plan = ctx.state().optimize(&logical_plan)?; | ||
| let physical_plan = ctx.state().create_physical_plan(&optimized_plan).await?; | ||
|
|
||
| // Serialize the physical plan - bug may happen here already but not necessarily manifests | ||
| let codec = DefaultPhysicalExtensionCodec {}; | ||
| let proto = PhysicalPlanNode::try_from_physical_plan(physical_plan.clone(), &codec)?; | ||
|
|
||
| // This will fail with the bug, but should succeed when fixed | ||
| let _deserialized_plan = | ||
| proto.try_into_physical_plan(&ctx, ctx.runtime_env().as_ref(), &codec)?; | ||
| Ok(()) | ||
| } | ||
|
|
||
| #[tokio::test] | ||
| /// Tests that we can serialize an unoptimized "analyze" plan and it will work on the other end | ||
| async fn analyze_roundtrip_unoptimized() -> Result<()> { | ||
|
|
@@ -2090,6 +2123,5 @@ async fn analyze_roundtrip_unoptimized() -> Result<()> { | |
| let physical_planner = | ||
| datafusion::physical_planner::DefaultPhysicalPlanner::default(); | ||
| physical_planner.optimize_physical_plan(unoptimized, &session_state, |_, _| {})?; | ||
|
|
||
| Ok(()) | ||
| } | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using the input schema always matches my understanding of how the FilterExec work 👍