xanderbailey opened a new pull request, #19856:
URL: https://github.com/apache/datafusion/pull/19856
## Which issue does this PR close?
- Closes #17508
## Rationale for this change
The previous implementation used UUID-based aliasing as a workaround to
prevent duplicate names for literals in Substrait plans. This approach had
several drawbacks:
- Non-deterministic plan names that made testing difficult (requiring UUID
regex filters)
- Only addressed literal naming conflicts, not the broader issue of name
deduplication
- Added unnecessary dependency on the `uuid` crate
- Didn't properly handle cases where the same qualified name could appear
with different schema representations
## What changes are included in this PR?
1. **Enhanced NameTracker**: Refactored to track both `schema_name()` and
`qualified_name()` separately, ensuring uniqueness across both naming dimensions
2. **Removed UUID dependency**: Eliminated the `uuid` crate from
`datafusion/substrait`
3. **Removed literal-specific aliasing**: The UUID-based workaround in
`project_rel.rs` is no longer needed as the improved NameTracker handles all
naming conflicts consistently
4. **Deterministic naming**: Name conflicts now use predictable `__temp__N`
suffixes instead of random UUIDs
## Are these changes tested?
Yes:
- Updated snapshot tests to reflect the new deterministic naming (e.g.,
`Utf8("people")__temp__0` instead of UUID-based names)
- Modified some roundtrip tests to verify semantic equivalence (schema
matching and execution) rather than exact string matching, which is more robust
- All existing integration tests pass with the new naming scheme
## Are there any user-facing changes?
Minimal. The generated plan names are now deterministic and more readable
(using `__temp__N` suffixes instead of UUIDs), but this is primarily an
internal representation change. The functional behavior and query results
remain unchanged.
--
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]