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

DB name is not set for AlterTable

Details

    • Bug
    • Status: Resolved
    • Critical
    • Resolution: Fixed
    • 2.0.0
    • 2.0.0
    • Sentry

    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.001.patch
          3 kB
          Na Li
        2. SENTRY-2066.002.patch
          4 kB
          Na Li
        3. SENTRY-2066.003.patch
          4 kB
          Na Li

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved:

                Slack

                  Issue deployment