[ASTERIXDB-3015][FUN] Fix avg() handling of first non-number
authorDmitry Lychagin <dmitry.lychagin@couchbase.com>
Wed, 16 Feb 2022 04:06:23 +0000 (20:06 -0800)
committerDmitry Lychagin <dmitry.lychagin@couchbase.com>
Wed, 16 Feb 2022 17:11:13 +0000 (17:11 +0000)
commit3fe860f40a50cb5ffaed2de33243e4cba2756574
tree25ae2ccc5ca1e01da1fbb2672ffd5cdf509282f5
parent2a983d2420e6ca7e938e7393e12fc9488be925b0
[ASTERIXDB-3015][FUN] Fix avg() handling of first non-number

- user model changes: no
- storage format changes: no
- interface changes: no

Details:
- Fix incorrect result produced by avg() function
  when its first input value is not a number

Change-Id: I21cc52c56fb79a609aabdf994a7b6e19d570b6ea
Reviewed-on: https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/15305
Integration-Tests: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Tested-by: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Reviewed-by: Dmitry Lychagin <dmitry.lychagin@couchbase.com>
Reviewed-by: Ali Alsuliman <ali.al.solaiman@gmail.com>
asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql-sugar/avg_mixed/avg_mixed.1.ddl.sqlpp [new file with mode: 0644]
asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql-sugar/avg_mixed/avg_mixed.2.update.sqlpp [new file with mode: 0644]
asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql-sugar/avg_mixed/avg_mixed.3.query.sqlpp [new file with mode: 0644]
asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql-sugar/avg_mixed/avg_mixed.4.query.sqlpp [new file with mode: 0644]
asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql-sugar/avg_mixed/avg_mixed.5.query.sqlpp [new file with mode: 0644]
asterixdb/asterix-app/src/test/resources/runtimets/results/aggregate-sql-sugar/avg_mixed/avg_mixed.3.adm [new file with mode: 0644]
asterixdb/asterix-app/src/test/resources/runtimets/results/aggregate-sql-sugar/avg_mixed/avg_mixed.4.adm [new file with mode: 0644]
asterixdb/asterix-app/src/test/resources/runtimets/results/aggregate-sql-sugar/avg_mixed/avg_mixed.5.adm [new file with mode: 0644]
asterixdb/asterix-app/src/test/resources/runtimets/testsuite_sqlpp.xml
asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/aggregates/std/AbstractAvgAggregateFunction.java