jonahgao commented on code in PR #13134:
URL: https://github.com/apache/datafusion/pull/13134#discussion_r1819053921
##########
datafusion/expr/src/logical_plan/builder.rs:
##########
@@ -1324,6 +1325,25 @@ pub fn change_redundant_column(fields: &Fields) ->
Vec<Field> {
})
.collect()
}
+
+fn mark_field(schema: &DFSchema) -> (Option<TableReference>, Arc<Field>) {
+ let mut table_references = schema
+ .iter()
+ .filter_map(|(qualifier, _)| qualifier)
+ .collect::<Vec<_>>();
+ table_references.dedup();
+ let table_reference = if table_references.len() == 1 {
+ table_references.pop().cloned()
+ } else {
+ None
+ };
+
+ (
+ table_reference,
+ Arc::new(Field::new("mark", DataType::Boolean, false)),
Review Comment:
Could this field name potentially conflict with user-defined column names?
If so, it might be necessary to add a special prefix, similar to
[CSE_PREFIX](https://github.com/apache/datafusion/blob/132b232b8861888348f05cc99d11bf1d2d4f1c63/datafusion/optimizer/src/common_subexpr_eliminate.rs#L40).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]