Skip to content

Maintain SQLGlot Fork to make it's optimizer more compatible #313

@vineetg3

Description

@vineetg3

We need to maintain a forked version of SQLGlot to address incompatibilities between our requirements and the standard SQLGlot optimizer.

We're currently skipping problematic rules:

  • The canonicalize rule (12) removes nested DATE functions, causing data loss:
    DATE(DATE(a,b),c) -> DATE(a,b)  # 'c' argument disappears
    
  • merge_subqueries rules break ANTI/SEMI joins if not conditionally skipped.
  • unnest_subqueries creates tries to remove ANTI/SEMI join but creates aliases with no corresponding tables.

Proposed Solution

Fork SQLGlot to fix these optimizer bugs directly in the source, allowing us to use the optimizer without skipping critical rules.

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentationeffort - highmajor issue that will require multiple steps or complex designoptimizationImproving the speed/quality of PyDough's outputs

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions