hive-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Thomas Friedrich (JIRA)" <>
Subject [jira] [Created] (HIVE-8790) UT: fix hook_context_cs test case
Date Fri, 07 Nov 2014 23:51:33 GMT
Thomas Friedrich created HIVE-8790:

             Summary: UT: fix hook_context_cs test case
                 Key: HIVE-8790
             Project: Hive
          Issue Type: Sub-task
          Components: Tests
    Affects Versions: spark-branch
            Reporter: Thomas Friedrich
            Priority: Minor

The test hook_context_cs fails while checking for expected value in VerifyContentSummaryCacheHook:
  TestSparkCliDriver.testCliDriver_hook_context_cs:120->runTest:146 Unexpected exception
junit.framework.AssertionFailedError: expected:<1> but was:<0>
	at junit.framework.Assert.failNotEquals(
	at junit.framework.Assert.assertEquals(
	at junit.framework.Assert.assertEquals(
	at junit.framework.Assert.assertEquals(
	at org.apache.hadoop.hive.ql.Driver.execute(
	at org.apache.hadoop.hive.ql.Driver.runInternal(

The problem is that the post-hook check in org.apache.hadoop.hive.ql.hooks.VerifyContentSummaryCacheHook
fails because inputToCS.size is 0 instead of 1:
Assert.assertEquals(1, inputToCS.size());

I ran the same test with TestCliDriver where Hive will create MapRedTask objects. For a MapRedTask,
the hookContext.getInputPathToContentSummary() is set in the setNumberOfReducers method, line
inputSummary =  Utilities.getInputSummary(driverContext.getCtx(), work.getMapWork(), null);
(the path is added in 	Utilities.getInputSummary(Context, MapWork, PathFilter) line: 2584).

Since we have a SparkTask, the array will be empty, hence the check for length==1 fails. 

It looks somewhat related to HIVE-8504 where the test case also configures a,
but since it's a different post-hook class altogether, I wanted to open a separate JIRA for
Maybe something needs to be added to the SparkTask.

This message was sent by Atlassian JIRA

View raw message