Uploaded image for project: 'Beam'
  1. Beam
  2. BEAM-9179

Refactor Beam ZetaSQL type translation code

Details

    • Improvement
    • Status: Resolved
    • P3
    • Resolution: Fixed
    • None
    • 2.28.0
    • dsl-sql-zetasql
    • None

    Description

      Currently, how types work in Beam ZetaSQL is very confusing: code that does type conversion between Calcite/Beam/ZetaSQL type systems are everywhere and is likely to be not consistent. In addition, the recent migration to BeamZetaSqlCalcRel makes the situation even worse: it adds another layer for type conversion and makes a lot of code (for making ZetaSQL functions manually) obsolete. This makes debugging and supporting new features very hard. A few examples:

      • Support new ZetaSQL types (e.g. DATE/TIME/DATETIME)
      • Fix the long-standing precision & timezone issue of TIMESTMAP type
      • Support BeamSQL query parameters

      Therefore, I propose we work on the following items to make the story of Beam ZetaSQL type clearer:

      • Define a clear mapping between Calcite/Beam/ZetaSQL types and values
      • Refactor the codebase to move all type conversion code to a single source of truth
      • Add thorough testing for it
      • Remove obsolete code that is added to make functions work before BeamZetaSqlCalcRel

      Attachments

        Activity

          People

            Unassigned Unassigned
            robinyqiu Robin Qiu
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0h
                0h
                Logged:
                Time Spent - 8h 20m
                8h 20m