It seems to me like there should be version with type X, [P,X,X] for all pair P and X. There might be a smart way to do this without the quadratic number of cases; someone else probably knows better than I do about that.
On Sun, May 14, 2017 at 1:00 AM, Vincent Tran <[email protected]> wrote: > Hey folks, > > I want to start contributing to learn the code base. I added this function > to my personal build: > > [['nvl2'], 'TINYINT', ['TINYINT', 'TINYINT', 'TINYINT'], > 'impala::ConditionalFunctions::NVL2'], > [['nvl2'], 'SMALLINT', ['SMALLINT', 'SMALLINT', 'SMALLINT'], > 'impala::ConditionalFunctions::NVL2'], > [['nvl2'], 'INT', ['INT', 'INT', 'INT'], > 'impala::ConditionalFunctions::NVL2'], > [['nvl2'], 'BIGINT', ['BIGINT', 'BIGINT', 'BIGINT'], > 'impala::ConditionalFunctions::NVL2'], > [['nvl2'], 'FLOAT', ['FLOAT', 'FLOAT', 'FLOAT'], > 'impala::ConditionalFunctions::NVL2'], > [['nvl2'], 'DOUBLE', ['DOUBLE', 'DOUBLE', 'DOUBLE'], > 'impala::ConditionalFunctions::NVL2'], > [['nvl2'], 'DECIMAL', ['DECIMAL', 'DECIMAL', 'DECIMAL'], > 'impala::ConditionalFunctions::NVL2'], > [['nvl2'], 'STRING', ['STRING', 'STRING', 'STRING'], > 'impala::ConditionalFunctions::NVL2'], > [['nvl2'], 'TIMESTAMP', ['TIMESTAMP', 'TIMESTAMP', 'TIMESTAMP'], > 'impala::ConditionalFunctions::NVL2'], > > > Do you think this is a sound approach? Should we allow mix types for this > function? > > i.e. nvl2(string, int, timestamp) > > > https://issues.cloudera.org/browse/IMPALA-5030 > > > -- > Vincent T. Tran > Customer Operations Engineer > Cloudera, Inc.
