Skip to content

I'm confused by TotalNumOfLettersGenericUDAF.TotalNumOfLettersEvaluator.reset #3

@ylyhlh

Description

@ylyhlh

Thanks a lot for the great tutorial about UDF and UDAF, they are awesome and extremely helpful!
But I got a little confused by TotalNumOfLettersGenericUDAF.TotalNumOfLettersEvaluator.reset function

Original it is, looks like nothing did here:

    public void reset(AggregationBuffer agg) throws HiveException {
        LetterSumAgg myagg = new LetterSumAgg();
    }

In my view it should look like this:

    public void reset(AggregationBuffer agg) throws HiveException {
        ((LetterSumAgg)agg).sum = 0;
    }

Maybe I'm wrong, if so can you tell me what did the reset function should do here,

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions