-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/20264/#review40495
-----------------------------------------------------------
I found a bug that coalesce() cannot handle one argument case.
For example, coalesce('value1') should return 'value1' but returns
"NoSuchFunctionException: function coalesce(text) does not exist."
I think that paramDiff can be 0 not only in the case of non-variable length
arguments but also with array argument of one element.
- Keuntae Park
On April 11, 2014, 4:29 p.m., hyoungjun kim wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/20264/
> -----------------------------------------------------------
>
> (Updated April 11, 2014, 4:29 p.m.)
>
>
> Review request for Tajo.
>
>
> Bugs: TAJO-746
> https://issues.apache.org/jira/browse/TAJO-746
>
>
> Repository: tajo
>
>
> Description
> -------
>
> See title.
> The next description is from the postgresql
> document(http://www.postgresql.org/docs/9.1/static/functions-conditional.html).
>
>
> {noformat}
> COALESCE(value [, ...])
> {noformat}
> The COALESCE function returns the first of its arguments that is not null.
> Null is returned only if all arguments are null. It is often used to
> substitute a default value for null values when data is retrieved for
> display, for example:
> {code:sql}
> SELECT COALESCE(description, short_description, '(none)') ...
> {code}
> Like a CASE expression, COALESCE only evaluates the arguments that are needed
> to determine the result; that is, arguments to the right of the first
> non-null argument are not evaluated. This SQL-standard function provides
> capabilities similar to NVL and IFNULL, which are used in some other database
> systems.
>
>
> Diffs
> -----
>
>
> tajo-catalog/tajo-catalog-common/src/main/java/org/apache/tajo/catalog/CatalogUtil.java
> 7555325
>
> tajo-catalog/tajo-catalog-common/src/test/java/org/apache/tajo/catalog/TestCatalogUtil.java
> 75149e9
>
> tajo-catalog/tajo-catalog-server/src/main/java/org/apache/tajo/catalog/CatalogServer.java
> b32b4e9
>
> tajo-core/tajo-core-backend/src/main/java/org/apache/tajo/engine/function/builtin/Coalesce.java
> PRE-CREATION
>
> tajo-core/tajo-core-backend/src/main/java/org/apache/tajo/engine/function/builtin/CoalesceDouble.java
> PRE-CREATION
>
> tajo-core/tajo-core-backend/src/main/java/org/apache/tajo/engine/function/builtin/CoalesceLong.java
> PRE-CREATION
>
> tajo-core/tajo-core-backend/src/main/java/org/apache/tajo/engine/function/builtin/CoalesceString.java
> PRE-CREATION
>
> tajo-core/tajo-core-backend/src/test/java/org/apache/tajo/engine/function/TestBuiltinFunctionsExpr.java
> PRE-CREATION
>
> Diff: https://reviews.apache.org/r/20264/diff/
>
>
> Testing
> -------
>
> mvn clean install;
>
>
> Thanks,
>
> hyoungjun kim
>
>