facebookincubator / velox

A C++ vectorized database acceleration library aimed to optimizing query engines and data processing systems.
https://velox-lib.io/
Apache License 2.0
3.4k stars 1.11k forks source link

Aggregation function fuzzer test should support constant function signature #4633

Open jinchengchenghh opened 1 year ago

jinchengchenghh commented 1 year ago

Bug description

SparkSql function bloom_filter_agg and PrestoSql function approx_most_frequent has constant argument, now the aggregation fuzzer test will throw exception for them.

Expected: Pass Actual:

/mnt/DP_disk1/code/velox/build/velox/exec/tests# ./spark_aggregation_fuzzer_test
E0414 09:32:32.838361 1385171 Exceptions.h:68] Line: /mnt/DP_disk1/code/velox/velox/functions/sparksql/aggregates/BloomFilterAggAggregate.cpp:237, Function:setConstantArgument, Expression: vec.isConstantMapping() originalEstimatedNumItems argument must be constant for all input rows, Source: RUNTIME, ErrorCode: INVALID_STATE
terminate called after throwing an instance of 'facebook::velox::VeloxRuntimeError'
  what():  Exception: VeloxRuntimeError
Error Source: RUNTIME
Error Code: INVALID_STATE
Reason: originalEstimatedNumItems argument must be constant for all input rows
Retriable: False
Expression: vec.isConstantMapping()
Function: setConstantArgument
File: /mnt/DP_disk1/code/velox/velox/functions/sparksql/aggregates/BloomFilterAggAggregate.cpp
Line: 237
Stack trace:
# 0
# 1

System information

Velox System Info v0.0.2 Commit: 72352fb1c3365defd008ed28a31618c149f0dc05 CMake Version: 3.24.0 System: Linux-5.4.0-144-generic Arch: x86_64 C++ Compiler: /usr/bin/c++ C++ Compiler Version: 9.4.0 C Compiler: /usr/bin/cc C Compiler Version: 9.4.0 CMake Prefix Path: /usr/local;/usr;/;/usr/local;/usr/local;/usr/X11R6;/usr/pkg;/opt

Relevant logs

No response

jinchengchenghh commented 1 year ago

@duanmeng Can you help fix it?