Details

Description

org.apache.hadoop.hive.ql.exec.DDLTask handles DDL operations in Hive.
Some operations (those exposed as REST API by Templeton) in this class, write a JSON object to stdout (on failure) which includes "error" and "errorCode" fields. "errorCode" is set to values like 404, 500, etc. i.e. Http Status codes. I believe this was done to support Templeton REST API. This is not the right place to introduce Http codes.

DDLTask should use canonical error messages defined in org.apache.hadoop.hive.ql.ErrorMsg and propagate it up to HCatCli which can decide how to encode the error and to which stream. In particular it can create a parseable JSON object which Templeton can then interpret. JSON object can also be generated here for errors from the parser/resolver (e.g. trying to describe a table which doesn't exist).

Then Templeton can map the canonical error code to appropriate Http Code.

The HIVE-4580.patch includes the following:
Some DDL operations in Hive (DDLTask) used to produce HTTP Status codes to support WebHCat (Templeton). These operations now produce canonical errors based on ErrorMsg.
WebHCat then maps the canonical error code to appropriate HTTP Status.

Due to this refactoring a number of .q.out files changed though the changes are cosmetic.

A new set of unit tests TestWebHCatE2e is added. These tests start a WebHCat server and make REST calls to it. Unlike hcatalog/src/test/e2e/templeton e2e tests, these are JUnit test and don't require any set up. These are suitable for DLL operation tests.

Eugene Koifman
added a comment - 13/Jun/13 01:56 The HIVE-4580 .patch includes the following:
Some DDL operations in Hive (DDLTask) used to produce HTTP Status codes to support WebHCat (Templeton). These operations now produce canonical errors based on ErrorMsg.
WebHCat then maps the canonical error code to appropriate HTTP Status.
Due to this refactoring a number of .q.out files changed though the changes are cosmetic.
A new set of unit tests TestWebHCatE2e is added. These tests start a WebHCat server and make REST calls to it. Unlike hcatalog/src/test/e2e/templeton e2e tests, these are JUnit test and don't require any set up. These are suitable for DLL operation tests.

Eugene Koifman
added a comment - 09/Jul/13 15:13 I can fix the checkstyle issue.
Why do you think this is causing disks to fill up. There is nothing in this change that writes anything to disk (that I know of).