doris
doris copied to clipboard
[Bug] BitmapUnion and toBitmap UDAF throws NPE when the mapreduce job only has map task
Search before asking
- [X] I had searched in the issues and found no similar issues.
Version
1.1.3-rc02
What's Wrong?
When using the UDF in hive to get a doris bitmap representation of a column (e.g. bitmap_union, to_bitmap), an NPE occurs if the submitted mapreduce job only has map task, no reduce task. The exception stack is as below:

This is because in BitmapUnionUDAF/ToBitmapUDAF, the Mode should be Mode.COMPLETE, so the BinaryObjectInspector inputOI will not be initialized here:

What You Expected?
run successfully and get doris representation bitmap result.
How to Reproduce?
e.g. creating as temporary function, query and run with only map task, no reduce task
Anything Else?
No response
Are you willing to submit PR?
- [X] Yes I am willing to submit a PR!
Code of Conduct
- [X] I agree to follow this project's Code of Conduct