Uploaded image for project: 'Ignite'
  1. Ignite
  2. IGNITE-7373

Fix style guide violations and imprecise naming in SqlParser-related code

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Won't Fix
    • 2.4
    • None
    • sql
    • None

    Description

      SQL parser implementation contains many abbreviation rule violations and names that doesn't reflect the method intention:

      1. "token" instead of "tok" in variables
      2. SqlParserUtils.skipIfMatches throws an exception if the token doesn't match, although the name doesn't reflect this. 'accept' or 'skip' without 'if' would be more precise
      3. SqlKeyword.DEFAULT clashes with SqlParserTokenType.DEFAULT
      4. SqlParserUtils.skipCommaOrRightParenthesis() can be generalized. It's better to return the token it's met instead of obscure boolean (otherwise the name should reflect the returned type)
      5. It makes sense to have a method to return the current token. The container can be refactored from SqlLexerLookAheadToken, since lookahead token doesn't need it's own class.
      6. SqlLexerTokenType.EOF does not mean 'end of FILE'.

      Attachments

        Activity

          People

            Unassigned Unassigned
            kirill.shirokov Kirill Shirokov
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: