[ 
https://issues.apache.org/jira/browse/HIVE-19247?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16450218#comment-16450218
 ] 

Gopal V commented on HIVE-19247:
--------------------------------

Failures are unrelated, but two of failed the tests failed to startup the 
CliDriver fully.

{code}
java.lang.AssertionError: Failed during initFromDatasets processLine with code=2
        at org.junit.Assert.fail(Assert.java:88)
        at org.apache.hadoop.hive.ql.QTestUtil.initDataset(QTestUtil.java:1227)
        at 
org.apache.hadoop.hive.ql.QTestUtil.initDataSetForTest(QTestUtil.java:1207)
        at org.apache.hadoop.hive.ql.QTestUtil.cliInit(QTestUtil.java:1275)
        at 
org.apache.hadoop.hive.cli.control.CoreCliDriver.runTest(CoreCliDriver.java:176)
        at 
org.apache.hadoop.hive.cli.control.CliAdapter.runTest(CliAdapter.java:104)
        at 
org.apache.hadoop.hive.cli.TestCliDriver.testCliDriver(TestCliDriver.java:5
{code}

> StatsOptimizer: Missing stats fast-path for Date
> ------------------------------------------------
>
>                 Key: HIVE-19247
>                 URL: https://issues.apache.org/jira/browse/HIVE-19247
>             Project: Hive
>          Issue Type: Bug
>          Components: Statistics
>    Affects Versions: 2.2.0, 3.0.0, 2.3.2
>            Reporter: Gopal V
>            Assignee: Gopal V
>            Priority: Major
>         Attachments: HIVE-19247.1.patch
>
>
> {code}
> 2018-04-19T18:57:24,268 DEBUG [67259108-c184-4c92-9e18-9e2969244442 
> HiveServer2-Handler-Pool: Thread-73]: optimizer.StatsOptimizer 
> (StatsOptimizer.java:process(614)) - Unsupported type: date encountered in 
> metadata optimizer for column : jour
> {code}
> {code}
> if (udaf instanceof GenericUDAFMin) {
>             ExprNodeColumnDesc colDesc = 
> (ExprNodeColumnDesc)exprMap.get(((ExprNodeColumnDesc)aggr.getParameters().get(0)).getColumn());
>             String colName = colDesc.getColumn();
>             StatType type = getType(colDesc.getTypeString());
>             if (!tbl.isPartitioned()) {
>               if 
> (!StatsSetupConst.areColumnStatsUptoDate(tbl.getParameters(), colName)) {
>                 Logger.debug("Stats for table : " + tbl.getTableName() + " 
> column " + colName
>                     + " are not up to date.");
>                 return null;
>               }
>               ColumnStatisticsData statData = 
> hive.getMSC().getTableColumnStatistics(
>                   tbl.getDbName(), tbl.getTableName(), 
> Lists.newArrayList(colName))
>                   .get(0).getStatsData();
>               String name = colDesc.getTypeString().toUpperCase();
>               switch (type) {
>                 case Integeral: {
>                   LongSubType subType = LongSubType.valueOf(name);
>                   LongColumnStatsData lstats = statData.getLongStats();
>                   if (lstats.isSetLowValue()) {
>                     oneRow.add(subType.cast(lstats.getLowValue()));
>                   } else {
>                     oneRow.add(null);
>                   }
>                   break;
>                 }
>                 case Double: {
>                   DoubleSubType subType = DoubleSubType.valueOf(name);
>                   DoubleColumnStatsData dstats = statData.getDoubleStats();
>                   if (dstats.isSetLowValue()) {
>                     oneRow.add(subType.cast(dstats.getLowValue()));
>                   } else {
>                     oneRow.add(null);
>                   }
>                   break;
>                 }
>                 default: // unsupported type
>                   Logger.debug("Unsupported type: " + colDesc.getTypeString() 
> + " encountered in " +
>                       "metadata optimizer for column : " + colName);
>                   return null;
>               }
>             }
> {code}
> {code}
>     enum StatType{
>       Integeral,
>       Double,
>       String,
>       Boolean,
>       Binary,
>       Unsupported
>     }
>     enum LongSubType {
>       BIGINT { @Override
>       Object cast(long longValue) { return longValue; } },
>       INT { @Override
>       Object cast(long longValue) { return (int)longValue; } },
>       SMALLINT { @Override
>       Object cast(long longValue) { return (short)longValue; } },
>       TINYINT { @Override
>       Object cast(long longValue) { return (byte)longValue; } };
>       abstract Object cast(long longValue);
>     }
> {code}
> Date is stored in stats (& also the typo there).



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to