Uploaded image for project: 'Hue'
  1. Hue
  2. HUE-6831

[metastore] Editing view comments should use ALTER VIEW instead of TABLE

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 3.12.0
    • Fix Version/s: None
    • Component/s: app.catalog
    • Labels:
      None

      Description

      From Daniel on http://gethue.com/browsing-hive-tables-data-and-metadata-is-getting-faster-and-prettier/


      Hi, I created a table in the SQL editor without column comments. So is showing: “from deserializer”, I change the comment but it seems that is not updating, because when I come back is showing “from deserializer” again. Any thoughts?

      Apparently the problem is because i’m using:
      ROW FORMAT SERDE ‘org.apache.hadoop.hive.serde2.OpenCSVSerde’ in the table creation.

      Anyway, I created a view to point to that table, but when I try to update the column comments I have an error:

      Failed to alter column `default`.`fc_full_view` `id`: Bad status for request TExecuteStatementReq(confOverlay={}, sessionHandle=TSessionHandle(sessionId=THandleIdentifier(secret=’z2\x8b\xa6\xe2\xb8Gi\xaf\x90\x02\x1e\x021\xaeK’, guid=’\xaei>e\xa7\xe9OJ\xb8\xc1 +\x1c\xc2~\x1a’)), runAsync=True, statement=”ALTER TABLE `default`.`fc_full_view` CHANGE COLUMN `id` `id` INT COMMENT ‘ID ‘”): TExecuteStatementResp(status=TStatus(errorCode=10131, errorMessage=’Error while compiling statement: FAILED: SemanticException [Error 10131]: To alter a view you need to use the ALTER VIEW command.’, sqlState=’42000′, infoMessages=[‘*org.apache.hive.service.cli.HiveSQLException:Error while compiling statement: FAILED: SemanticException [Error 10131]: To alter a view you need to use the ALTER VIEW command.:47:46’, ‘org.apache.hive.service.cli.operation.Operation:toSQLException:Operation.java:335’, ‘org.apache.hive.service.cli.operation.SQLOperation:prepare:SQLOperation.java:148’, ‘org.apache.hive.service.cli.operation.SQLOperation:runInternal:SQLOperation.java:226’, ‘org.apache.hive.service.cli.operation.Operation:run:Operation.java:276’, ‘org.apache.hive.service.cli.session.HiveSessionImpl:executeStatementInternal:HiveSessionImpl.java:468’, ‘org.apache.hive.service.cli.session.HiveSessionImpl:executeStatementAsync:HiveSessionImpl.java:456’, ‘sun.reflect.GeneratedMethodAccessor101:invoke::-1’, ‘sun.reflect.DelegatingMethodAccessorImpl:invoke:DelegatingMethodAccessorImpl.java:43’, ‘java.lang.reflect.Method:invoke:Method.java:498’, ‘org.apache.hive.service.cli.session.HiveSessionProxy:invoke:HiveSessionProxy.java:78’, ‘org.apache.hive.service.cli.session.HiveSessionProxy:access$000:HiveSessionProxy.java:36’, ‘org.apache.hive.service.cli.session.HiveSessionProxy$1:run:HiveSessionProxy.java:63’, ‘java.security.AccessController:doPrivileged:AccessController.java:-2’, ‘javax.security.auth.Subject:doAs:Subject.java:422’, ‘org.apache.hadoop.security.UserGroupInformation:doAs:UserGroupInformation.java:1724’, ‘org.apache.hive.service.cli.session.HiveSessionProxy:invoke:HiveSessionProxy.java:59’, ‘com.sun.proxy.$Proxy23:executeStatementAsync::-1’, ‘org.apache.hive.service.cli.CLIService:executeStatementAsync:CLIService.java:298’, ‘org.apache.hive.service.cli.thrift.ThriftCLIService:ExecuteStatement:ThriftCLIService.java:506’, ‘org.apache.hive.service.cli.thrift.TCLIService$Processor$ExecuteStatement:getResult:TCLIService.java:1317’, ‘org.apache.hive.service.cli.thrift.TCLIService$Processor$ExecuteStatement:getResult:TCLIService.java:1302’, ‘org.apache.thrift.ProcessFunction:process:ProcessFunction.java:39’, ‘org.apache.thrift.TBaseProcessor:process:TBaseProcessor.java:39’, ‘org.apache.thrift.server.TServlet:doPost:TServlet.java:83’, ‘org.apache.hive.service.cli.thrift.ThriftHttpServlet:doPost:ThriftHttpServlet.java:206’, ‘javax.servlet.http.HttpServlet:service:HttpServlet.java:727’, ‘javax.servlet.http.HttpServlet:service:HttpServlet.java:820’, ‘org.eclipse.jetty.servlet.ServletHolder:handle:ServletHolder.java:565’, ‘org.eclipse.jetty.servlet.ServletHandler:doHandle:ServletHandler.java:479’, ‘org.eclipse.jetty.server.session.SessionHandler:doHandle:SessionHandler.java:225’, ‘org.eclipse.jetty.server.handler.ContextHandler:doHandle:ContextHandler.java:1031’, ‘org.eclipse.jetty.servlet.ServletHandler:doScope:ServletHandler.java:406’, ‘org.eclipse.jetty.server.session.SessionHandler:doScope:SessionHandler.java:186’, ‘org.eclipse.jetty.server.handler.ContextHandler:doScope:ContextHandler.java:965’, ‘org.eclipse.jetty.server.handler.ScopedHandler:handle:ScopedHandler.java:117’, ‘org.eclipse.jetty.server.handler.HandlerWrapper:handle:HandlerWrapper.java:111’, ‘org.eclipse.jetty.server.Server:handle:Server.java:349’, ‘org.eclipse.jetty.server.AbstractHttpConnection:handleRequest:AbstractHttpConnection.java:449’, ‘org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler:content:AbstractHttpConnection.java:925’, ‘org.eclipse.jetty.http.HttpParser:parseNext:HttpParser.java:857’, ‘org.eclipse.jetty.http.HttpParser:parseAvailable:HttpParser.java:235’, ‘org.eclipse.jetty.server.AsyncHttpConnection:handle:AsyncHttpConnection.java:76’, ‘org.eclipse.jetty.io.nio.SelectChannelEndPoint:handle:SelectChannelEndPoint.java:609’, ‘org.eclipse.jetty.io.nio.SelectChannelEndPoint$1:run:SelectChannelEndPoint.java:45’, ‘java.util.concurrent.ThreadPoolExecutor:runWorker:ThreadPoolExecutor.java:1142’, ‘java.util.concurrent.ThreadPoolExecutor$Worker:run:ThreadPoolExecutor.java:617’, ‘java.lang.Thread:run:Thread.java:745’, ‘*org.apache.hadoop.hive.ql.parse.SemanticException:To alter a view you need to use the ALTER VIEW command.:56:10’, ‘org.apache.hadoop.hive.ql.parse.DDLSemanticAnalyzer:validateAlterTableType:DDLSemanticAnalyzer.java:1296’, ‘org.apache.hadoop.hive.ql.parse.DDLSemanticAnalyzer:addInputsOutputsAlterTable:DDLSemanticAnalyzer.java:1492’, ‘org.apache.hadoop.hive.ql.parse.DDLSemanticAnalyzer:addInputsOutputsAlterTable:DDLSemanticAnalyzer.java:1438’, ‘org.apache.hadoop.hive.ql.parse.DDLSemanticAnalyzer:analyzeAlterTableRenameCol:DDLSemanticAnalyzer.java:2649’, ‘org.apache.hadoop.hive.ql.parse.DDLSemanticAnalyzer:analyzeInternal:DDLSemanticAnalyzer.java:280’, ‘org.apache.hadoop.hive.ql.parse.BaseSemanticAnalyzer:analyze:BaseSemanticAnalyzer.java:230’, ‘org.apache.hadoop.hive.ql.Driver:compile:Driver.java:464’, ‘org.apache.hadoop.hive.ql.Driver:compile:Driver.java:320’, ‘org.apache.hadoop.hive.ql.Driver:compileInternal:Driver.java:1219’, ‘org.apache.hadoop.hive.ql.Driver:compileAndRespond:Driver.java:1213’, ‘org.apache.hive.service.cli.operation.SQLOperation:prepare:SQLOperation.java:146’], statusCode=3), operationHandle=None)

      It seems that is trying to do an ALTER TABLE instead of an ALTER VIEW?

        Attachments

          Activity

            People

            • Assignee:
              yingc Ying Chen
              Reporter:
              enricoberti Enrico Berti
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: