hive-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jesus Camacho Rodriguez (JIRA)" <>
Subject [jira] [Commented] (HIVE-10874) Fail in TestMinimrCliDriver.testCliDriver_ql_rewrite_gbtoidx_cbo_2.q due to duplicate column name
Date Mon, 01 Jun 2015 23:31:17 GMT


Jesus Camacho Rodriguez commented on HIVE-10874:

[~jpullokkaran], this problem is not only in Hive, the patch should go into Calcite too, and
once the next release is out, we could remove it from here.

In this case, the condition is risen because we have the following plan:
Aggregate (f_1, sum(f_1)) 
    Aggregate (x, sum(x)) ...
    Aggregate (x, sum(x))  ...
where f1 is the column with the result of sum(x).

The problem is that Calcite derives the row schema for the aggregation column sum(f1) automatically.
The generated name is f_1 ('f' of function, 1 of the position in the tuple), which is the
same one that the first column has; however, Calcite was not verifying if the autogenerated
name was already in the tuple or not. This patch checks if the name already exists, and while
it does, it generates a new column name.

> Fail in TestMinimrCliDriver.testCliDriver_ql_rewrite_gbtoidx_cbo_2.q due to duplicate
column name
> -------------------------------------------------------------------------------------------------
>                 Key: HIVE-10874
>                 URL:
>             Project: Hive
>          Issue Type: Bug
>            Reporter: Jesus Camacho Rodriguez
>            Assignee: Jesus Camacho Rodriguez
>         Attachments: HIVE-10874.patch
> Aggregate operators may derive row types with duplicate column names. The reason is that
the column names for grouping sets columns and aggregation columns might be generated automatically,
but we do not check whether the column name already exists in the same row.
> This error can be reproduced by TestMinimrCliDriver.testCliDriver_ql_rewrite_gbtoidx_cbo_2.q,
which fails with the following trace:
> {code}
> junit.framework.AssertionFailedError: Unexpected exception java.lang.AssertionError:
RecordType(BIGINT $f1, BIGINT $f1)
> 	at org.apache.calcite.rel.core.Project.isValid(
> 	at org.apache.calcite.rel.core.Project.<init>(
> 	at org.apache.calcite.rel.core.Project.<init>(
> 	at org.apache.hadoop.hive.ql.optimizer.calcite.reloperators.HiveProject.<init>(
> 	at org.apache.hadoop.hive.ql.optimizer.calcite.reloperators.HiveProject.create(
> 	at org.apache.hadoop.hive.ql.optimizer.calcite.translator.PlanModifierForASTConv.introduceDerivedTable(
> 	at org.apache.hadoop.hive.ql.optimizer.calcite.translator.PlanModifierForASTConv.convertOpTree(
> 	at org.apache.hadoop.hive.ql.optimizer.calcite.translator.ASTConverter.convert(
> 	at org.apache.hadoop.hive.ql.parse.CalcitePlanner.getOptimizedAST(
> 	at org.apache.hadoop.hive.ql.parse.CalcitePlanner.genOPTree(
> 	at org.apache.hadoop.hive.ql.parse.SemanticAnalyzer.analyzeInternal(
> 	at org.apache.hadoop.hive.ql.parse.CalcitePlanner.analyzeInternal(
> 	at org.apache.hadoop.hive.ql.parse.BaseSemanticAnalyzer.analyze(
> 	at org.apache.hadoop.hive.ql.parse.ExplainSemanticAnalyzer.analyzeInternal(
> 	at org.apache.hadoop.hive.ql.parse.BaseSemanticAnalyzer.analyze(
> ...
> {code}

This message was sent by Atlassian JIRA

View raw message