Uploaded image for project: 'Calcite'
  1. Calcite
  2. CALCITE-3416

SQL Dialects "DEFAULT"s should be more extensible

VotersWatch issueWatchersLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • None
    • 1.22.0
    • None

    Description

      The behavior of SQLDialect is partly governed by the methods defined on the given dialect subclass and partly governed by options passed in in a Context object. So every dialect subclass exposes a "DEFAULT" instance that has been initialized with the correct Context.

      However, if you then wish to extend the dialect for one reason or another, you must create a new instance to extend, or of course create a whole new subclass. In either case, you lose the options from the Context passed into the default, which governs important behavior of the dialect. You can copy-paste the relevant Context out of the Calcite code, but then you lose future improvements or fixes that might land in mainline Calcite.

      It would be nice if each dialect exposed the DEFAULT_CONTEXT that it passed into its DEFAULT instance as a public final member. Then, when extending the dialect, you simply initialize your extension with the DEFAULT_CONTEXT, and if any customization needs to happens on the Context options that's easy to do with the Context's API.

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            danny0405 Danny Chen
            swtalbot Steven Talbot
            Votes:
            0 Vote for this issue
            Watchers:
            5 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 - 40m
                40m

                Slack

                  Issue deployment