diff --git a/common/function-registry/impala_functions.py b/common/function-registry/impala_functions.py index a498fa60a..094e31b88 100755 --- a/common/function-registry/impala_functions.py +++ b/common/function-registry/impala_functions.py @@ -284,9 +284,9 @@ functions = [ '_ZN6impala18TimestampFunctions10DateAddSubILb0EiN5boost9date_time14years_durationINS2_9gregorian21greg_durations_configEEEEEPvPNS_4ExprEPNS_8TupleRowE'], [['years_sub'], 'TIMESTAMP', ['TIMESTAMP', 'BIGINT'], '_ZN6impala18TimestampFunctions10DateAddSubILb0ElN5boost9date_time14years_durationINS2_9gregorian21greg_durations_configEEEEEPvPNS_4ExprEPNS_8TupleRowE'], - [['months_add'], 'TIMESTAMP', ['TIMESTAMP', 'INT'], + [['months_add', 'add_months'], 'TIMESTAMP', ['TIMESTAMP', 'INT'], '_ZN6impala18TimestampFunctions10DateAddSubILb1EiN5boost9date_time15months_durationINS2_9gregorian21greg_durations_configEEEEEPvPNS_4ExprEPNS_8TupleRowE'], - [['months_add'], 'TIMESTAMP', ['TIMESTAMP', 'BIGINT'], + [['months_add', 'add_months'], 'TIMESTAMP', ['TIMESTAMP', 'BIGINT'], '_ZN6impala18TimestampFunctions10DateAddSubILb1ElN5boost9date_time15months_durationINS2_9gregorian21greg_durations_configEEEEEPvPNS_4ExprEPNS_8TupleRowE'], [['months_sub'], 'TIMESTAMP', ['TIMESTAMP', 'INT'], '_ZN6impala18TimestampFunctions10DateAddSubILb0EiN5boost9date_time15months_durationINS2_9gregorian21greg_durations_configEEEEEPvPNS_4ExprEPNS_8TupleRowE'], diff --git a/testdata/workloads/functional-query/queries/QueryTest/exprs.test b/testdata/workloads/functional-query/queries/QueryTest/exprs.test index aebce34a5..cfc6238da 100644 --- a/testdata/workloads/functional-query/queries/QueryTest/exprs.test +++ b/testdata/workloads/functional-query/queries/QueryTest/exprs.test @@ -1,5 +1,13 @@ ==== ---- QUERY +# check that add_months alias is working +select ADD_MONTHS(cast('2013-02-18 16:46:00.01' as timestamp), 1) +---- TYPES +timestamp +---- RESULTS +2013-03-18 16:46:00.010000000 +==== +---- QUERY # test extract with non-constant field name select b.unit, extract(a.ts, b.unit) from (values(cast('2013-02-18 16:46:00.01' as timestamp) ts)) a