Skip to content

It would be nice to have a way to generate unique IDs in optimizer rules #2886

Closed

Description

@avantgardnerio

Is your feature request related to a problem or challenge? Please describe what you are trying to do.

When writing optimizer rules, it is sometime necessary to generate things like aliases which must have unique names. Currently, there is no mutable context in which this can be done, so the only possibility is to use something like a UUID, which is both not easy to read and not deterministic for testing.

Describe the solution you'd like

For the reasons described above, it would be nice to make the OptimizerConfig mutable, so we can add a next_id() function to generate unique identifiers.

Describe alternatives you've considered

One could argue that this is an abuse of something called "config", and break out a separate context (which could possible wrap the existing immutable config).

Additional context

See PR #2885

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions