Details
-
Improvement
-
Status: Resolved
-
Minor
-
Resolution: Fixed
-
Impala 2.2
Description
A user reported on the user list that they were unable to access a constant argument from the Init function of a UDAF. It would be convenient in many cases to support this.
I'm adding a parameter to my version of the appx_median function to set the number of samples we want to store. My plan was to require that the number of samples parameter be a constant so I can allocate the memory for the samples in the Init function but I can't seem to access it in the Init function. if (! ctx->IsArgConstant(1)) { ctx->SetError("The number of samples must be a constant"); return; } If I include that check in my Init function, it always returns an error and I get back a NULL when I try to access the constant arg: int max_samples = reinterpret_cast<IntVal*>(ctx->GetConstantArg(1))->val;