[ 
https://issues.apache.org/jira/browse/HIVE-12213?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Aleksei S updated HIVE-12213:
-----------------------------
    Attachment: HIVE-12213.patch

I investigated the test and found that it's related to fast table stats update 
and it started failing after HIVE-10631. After more digging I found that it 
happens because of more stats being put into the table during its creation in 
target metastore which in turn is cause by a fact that directory for a table 
already existed during the second table creation (see test source).

As far as I understand "fast stats update" at table level should be done only 
for non-partitioned table. It's clear from the original patch in HIVE-3959 
where the method is even called "updateUnpartitionedTableStatsFast".

So, the fix I made is to do fast stats update only for non-partitioned tables 
during table creation. I can also put assert in "updateTableStatsFast()" to 
make sure it's called only for unpartitioned tables. Let me know if it's needed.

Note, that even though it fixes this test, it's possible to create a similar 
test with unpartitioned table which won't pass for exactly the same reason: 
directory will be existing in the second run and more stats will be put in (see 
line 229 in MetaStoreUtils with the check of !newDir). I cannot say it's a bug, 
because stats are correct in both cases, but it's more of a question whether 
zero values quick stats should be set for an empty table or not.


> Investigating the test failure TestHCatClient.testTableSchemaPropagation
> ------------------------------------------------------------------------
>
>                 Key: HIVE-12213
>                 URL: https://issues.apache.org/jira/browse/HIVE-12213
>             Project: Hive
>          Issue Type: Test
>          Components: Test
>    Affects Versions: 2.0.0
>            Reporter: Aihua Xu
>            Assignee: Aleksei S
>            Priority: Minor
>         Attachments: HIVE-12213.patch
>
>
> The test has been failing for some time with following error.
> {noformat}
> Error Message
> Table after deserialization should have been identical to sourceTable. 
> expected:<[TABLE_PROPERTIES]> but was:<[]>
> Stacktrace
> java.lang.AssertionError: Table after deserialization should have been 
> identical to sourceTable. expected:<[TABLE_PROPERTIES]> but was:<[]>
>       at org.junit.Assert.fail(Assert.java:88)
>       at org.junit.Assert.failNotEquals(Assert.java:743)
>       at org.junit.Assert.assertEquals(Assert.java:118)
>       at 
> org.apache.hive.hcatalog.api.TestHCatClient.testTableSchemaPropagation(TestHCatClient.java:1065)
> {noformat}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to