-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/18396/#review35227
-----------------------------------------------------------


This patch does as follows:
 * Change ExprNormalizer to not dissect an aggregation function which has a 
constant parameter.
 * Change LocalTajoTestingUtility to add fake statistics data to each TableDesc.
   * It is required to reproduce the error case.
   * As far as I know, this bug occurs only when one table large and small 
table is small.
   * Later, this fake statistics would be useful for making more various 
conditions.
 * Add an unit test to reproduce this bug case in TestCaseByCases.

In addition, I've cleaned up some of ExprNormalizer as follows:
 * Add OpType::isFunction(OpType) method to check if a OpType corresponds a 
function.
 * Add OpType::isLiteral(OpType) method to check if a OpType corresponds a 
literal value (i.e., constant value)
 * Add OpType::isAggregationFunction method to check if a OpType corresponds 
either GeneralSetFunction or CountRowFunction
 * Change ExprNormalizer to use the above methods. So, it is simplified a 
little bit than before.
 * Change CountRowFunction to inherent GeneralSetFunction instead of Function

- Hyunsik Choi


On Feb. 22, 2014, 8:05 p.m., Hyunsik Choi wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/18396/
> -----------------------------------------------------------
> 
> (Updated Feb. 22, 2014, 8:05 p.m.)
> 
> 
> Review request for Tajo.
> 
> 
> Bugs: TAJO-619
>     https://issues.apache.org/jira/browse/TAJO-619
> 
> 
> Repository: tajo
> 
> 
> Description
> -------
> 
> {code}
> select count(1) from table1 join table2 on table1.name = table2.name;
> {code}
> 
> When there are constant values in select list and equi-join keys are text 
> columns, it causes some errors due to schema mismatch.
> 
> Its cause of this bug is as follows:
>  * the number 1 results in a generated column name ?literal. 
>  * This name is used in both table1 and table2. Output schemas of table1 and 
> table2 include ?literal
>  * The input schema of join has only three columns because ?literal is 
> duplicated name.
> 
> So, its essential bug may be one of following:
>  * The constant value is evaluated twice. In other words, literal? occurs in 
> both table1 and table2.
>  * Schema class does not allow the same column name.
> 
> 
> Diffs
> -----
> 
>   
> tajo-algebra/src/main/java/org/apache/tajo/algebra/CountRowsFunctionExpr.java 
> cf2efb5e6a52a4ba2f1beff2f40a72f6a9932a80 
>   tajo-algebra/src/main/java/org/apache/tajo/algebra/FunctionExpr.java 
> b007362691eb9354d397f105d8d7e59350392de4 
>   
> tajo-algebra/src/main/java/org/apache/tajo/algebra/GeneralSetFunctionExpr.java
>  c45a58f1a9513ddbe43fa9685d917973807a5a52 
>   tajo-algebra/src/main/java/org/apache/tajo/algebra/OpType.java 
> 91f322b08810589b1ad6a4add19872e7150667cb 
>   
> tajo-core/tajo-core-backend/src/main/java/org/apache/tajo/engine/planner/ExprNormalizer.java
>  e7de03f10dbec2ab31ebe6d1baf160a2370149c6 
>   
> tajo-core/tajo-core-backend/src/main/java/org/apache/tajo/engine/planner/LogicalPlanner.java
>  756ede4e1d58732ae1079e789e9816bdfa4cd4ca 
>   
> tajo-core/tajo-core-backend/src/test/java/org/apache/tajo/LocalTajoTestingUtility.java
>  50fed7bd3f33a1305d1a1d325a1d4f8096b8d165 
>   
> tajo-core/tajo-core-backend/src/test/java/org/apache/tajo/engine/query/TestCaseByCases.java
>  20b5ac5c1d4fb695707149f9de606fc8ec3882dc 
>   
> tajo-core/tajo-core-backend/src/test/resources/queries/TestCaseByCases/testTAJO619Case.sql
>  PRE-CREATION 
>   
> tajo-core/tajo-core-backend/src/test/resources/results/TestCaseByCases/testTAJO619Case.result
>  PRE-CREATION 
> 
> Diff: https://reviews.apache.org/r/18396/diff/
> 
> 
> Testing
> -------
> 
> 
> Thanks,
> 
> Hyunsik Choi
> 
>

Reply via email to