Uploaded image for project: 'Sentry'
  1. Sentry
  2. SENTRY-2066

DB name is not set for AlterTable

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: 2.0.0
    • Fix Version/s: 2.0.0
    • Component/s: Sentry
    • Labels:

      Description

      SENTRY-1087 introduced a regression: the database name is not set in alter table column command.

      SENTRY-1087 added a new case below, and it causes the currDB not set because its children are "TOK_TABNAME" and "TOK_ALTERTABLE_RENAMECOL" NONE IS "TOK_ALTERTABLE_SERIALIZER"

      case HiveParser.TOK_ALTERTABLE:
            
                    for (Node childNode : ast.getChildren()) {
                      ASTNode childASTNode = (ASTNode) childNode;
                      if ("TOK_ALTERTABLE_SERIALIZER".equals(childASTNode.getText())) {
                        ASTNode serdeNode = (ASTNode) childASTNode.getChild(0);
                        String serdeClassName = BaseSemanticAnalyzer.unescapeSQLString(serdeNode.getText());
                        setSerdeURI(serdeClassName);
                        currDB = getCanonicalDb();
                      }
                    }
                    break;
      

        Attachments

        1. SENTRY-2066.003.patch
          4 kB
          Na Li
        2. SENTRY-2066.002.patch
          4 kB
          Na Li
        3. SENTRY-2066.001.patch
          3 kB
          Na Li

          Issue Links

            Activity

              People

              • Assignee:
                linaataustin Na Li
                Reporter:
                linaataustin Na Li
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: