[
https://issues.apache.org/jira/browse/HIVE-7470?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14070026#comment-14070026
]
Damien Carol commented on HIVE-7470:
------------------------------------
Exception are throws because show_compact() return object
{{ShowCompactResponse}}.
Main property of {{ShowCompactResponse}} is a list of
{{ShowCompactResponseElement}}
Thrift definition of {{ShowCompactResponseElement}} is :
{noformat}
struct ShowCompactResponseElement {
1: required string dbname,
2: required string tablename,
3: required string partitionname,
4: required CompactionType type,
5: required string state,
6: required string workerid,
7: required i64 start,
8: required string runAs,
}
{noformat}
But in metastore database, table which store compactions infos is defined with
non required properties :
{code:sql}
CREATE TABLE "COMPACTION_QUEUE"
(
"CQ_ID" bigint NOT NULL,
"CQ_DATABASE" character varying(128) NOT NULL,
"CQ_TABLE" character varying(128) NOT NULL,
"CQ_PARTITION" character varying(767),
"CQ_STATE" character(1) NOT NULL,
"CQ_TYPE" character(1) NOT NULL,
"CQ_WORKER_ID" character varying(128),
"CQ_START" bigint,
"CQ_RUN_AS" character varying(128),
CONSTRAINT "COMPACTION_QUEUE_pkey" PRIMARY KEY ("CQ_ID")
)
{code}
Also, ACID code store NULL values in this table.
This throws exceptions when doing {{SHOW COMPACTIONS}} in CLI because metastore
Thrift server try to send {{ShowCompactResponseElement}} with required
properties to NULL.
Properties that throws errors :
1. {{partitionname}}, when the table have no partition
2. {{workerid}}, {{start, {{runAs}} when the table have partitions
> Wrong Thrift declaration for {{ShowCompactResponseElement}}
> -----------------------------------------------------------
>
> Key: HIVE-7470
> URL: https://issues.apache.org/jira/browse/HIVE-7470
> Project: Hive
> Issue Type: Bug
> Components: Metastore, Thrift API
> Affects Versions: 0.14.0
> Reporter: Damien Carol
> Assignee: Damien Carol
> Priority: Minor
> Labels: metastore, thrift
> Fix For: 0.14.0
>
>
> Prerequiste :
> 1. Remote metastore
> 2. Activate ACID and compactions
> 3. Launch ALTER TABLE foo COMPACT 'bar'
> 4. Call {{show_compact()}} on remote metastore
> This use case throws exception in Thrift stack.
--
This message was sent by Atlassian JIRA
(v6.2#6252)