`Expr::Not` and `PhysicalExpr::NotExpr` have different metadata propagation rules
維護者通常 1 天內回覆
還沒有人認領這個 Issue。
評估
研究方向
The reproduction identifies Expr::Not::to_field and physical NotExpr::return_field as the paths with different metadata results. Read those implementations and nearby expression metadata tests first; the issue leaves open which behavior is correct. Decide on consistent propagation rules, add a regression test for the chosen behavior, and verify logical and physical fields agree.
由索引模型根據 Issue 內容生成。
描述
Describe the bug
The logical an physical representations of NOT propagate metadata differently.
I'm actually not sure which one is more correct...some metadata uses like "sensor" or "where this value came from" probably are not lying after a NOT operation; however, it's also a little like a function call which would discard its output metadata.
To Reproduce
#[test]
fn not_metadata_differs_between_logical_and_physical() -> Result<()> {
let schema = Schema::new(vec![Field::new("flag", DataType::Boolean, false)]);
let df_schema = DFSchema::try_from(schema.clone())?;
let metadata = FieldMetadata::from(HashMap::from([(
"source".to_string(),
"input".to_string(),
)]));
let expr = Expr::Not(Box::new(
col("flag").alias_with_metadata("flag", Some(metadata)),
));
let logical_field = expr.to_field(&df_schema)?.1;
let physical_expr = create_physical_expr(
&expr,
&df_schema,
&ExecutionProps::new(),
&PhysicalPlanningContext::default(),
)?;
let physical_field = physical_expr.return_field(&schema)?;
// Logical NOT creates a metadata-free Boolean field.
assert_eq!(logical_field.metadata().get("source"), None);
// Physical NotExpr forwards its child's field metadata.
assert_eq!(
physical_field.metadata().get("source").map(String::as_str),
Some("input")
);
Ok(())
}
Expected behavior
I'd expect the result to match
Additional context
No response
Willingness to contribute
I would like to contribute a fix for this bug, but request guidance from the DataFusion community
- 主要語言
- Rust
- 星號
- 9.6k
- 分支
- 2.6k
- 平均合併
- 3 天 1 小時
- 30 天內合併 PR
- 361
環境準備
在瀏覽器裡用你自己的 GitHub 帳號啟動這個專案的開發容器。
- 沒有 Dockerfile 或 Docker Compose 檔案
- 有 Pull Request 範本
- 閱讀貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
apache/datafusion 的其他 Issue
-
bug
難度 2/5 1-3 小時 新手友好度 82/100
apache/datafusion#27406 · 1 則留言 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 72/100
apache/datafusion#27315 · 2 則留言 ·
維護者通常 1 天內回覆
-
bug
難度 2/5 1-3 小時 新手友好度 76/100
apache/datafusion#27094 · 1 則留言 ·
維護者通常 1 天內回覆
-
Substrait consumer doesn't recognise `shift_left` / `shift_right` from functions_arithmetic.yaml可能已有人在做 @jonasHanhan 於 10 天前認領。 未關閉bug
難度 2/5 1-3 小時 新手友好度 76/100
apache/datafusion#27059 ·
維護者通常 1 天內回覆
-
`ProjectionExprs::project_statistics` computes approximate `Statistics::total_byte_size` ignoring column stats可能已有人在做 @joseph-isaacs 於 10 天前認領。 未關閉bug
難度 2/5 1-3 小時 新手友好度 72/100
apache/datafusion#27050 ·
維護者通常 1 天內回覆
查看 apache/datafusion 的全部 Issue
相似的 Issue
-
難度 2/5 1-3 小時 新手友好度 62/100
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 70/100
維護者通常 1 天內回覆
-
C-Bug S-Needs-Triage
難度 2/5 1-3 小時 新手友好度 68/100
bevyengine/bevy#26536 ·
維護者通常 2 天內回覆
-
Component:Software Type:Cleanup
難度 2/5 1-3 小時 新手友好度 72/100
維護者通常 1 天內回覆
-
Soul sand and honey slow a gliding or flying player; vanilla's Player.getBlockSpeedFactor is 1.0 then可能已有人在做 關聯的 PR 仍在進行中或已合併。 未關閉
難度 2/5 1-3 小時 新手友好度 68/100
horizon-rust/horizon#16176 · 1 則留言 ·
維護者通常 1 天內回覆