Tim Armstrong has posted comments on this change.

Change subject: IMPALA-3931: arbitrary fixed-size uda intermediate types
......................................................................


Patch Set 13:

(8 comments)

http://gerrit.cloudera.org:8080/#/c/7526/13/be/src/codegen/codegen-anyval.h
File be/src/codegen/codegen-anyval.h:

PS13, Line 194: type
> delete
Done


PS13, Line 200: *Va
> Why not just "StringVal"?
Done


PS13, Line 201:  memory buffer
> should that just say "slot"?
Done


PS13, Line 207:  
> nit
Done


PS13, Line 232: native_ptr
> what's that?
Done


PS13, Line 232: pointer to
              :   /// a type, StringValue, or TimestampValue
> what does that mean?  did some search/replace for "native" get too aggressi
Done


http://gerrit.cloudera.org:8080/#/c/7526/13/be/src/exec/partitioned-aggregation-node.cc
File be/src/exec/partitioned-aggregation-node.cc:

Line 1689:         input_vals, dst, &updated_dst_val));
> a one line comment explaining why this is skipped would help
Done


http://gerrit.cloudera.org:8080/#/c/7526/12/be/src/udf/udf.h
File be/src/udf/udf.h:

PS12, Line 346: For UDAs that need a complex data structure as the intermediate 
state, the
              : /// intermediate type should be string and the UDA can cast the 
ptr to the structure
              : /// it is using.
              : ///
              : /// Memory Management: For allocations that are not returned to 
Impala, the UDA should use
              : /// the FunctionContext::Allocate()/Free() methods. In general, 
Allocate() is called in
              : /// Init(), and then Free() must be called in both Serialize() 
and Finalize(), since
              : /// either of these functions may be called to clean up the 
state. For StringVal
              : /// allocations returned to Impala (e.g. returned by 
UdaSerialize()), the UDA should
              : /// allocate the result via StringVal(FunctionContext*, int) 
ctor or the function
              : /// StringVal::CopyFrom(FunctionContext*, const uint8_t*, 
size_t) and Impala will
              : /// automatically handle freeing it.
> Yeah, that's true, it shouldn't be documented here.  I'm just not sure it's
I extended the comment in PrimitiveType.java and 
partitioned-aggregation-node.cc to clarify a bit more.

That is a good point that it's hard to understand why functions in 
aggregate-functions-ir.cc are using different memory management schemes. I 
added pointers to the various init functions, where they were previously 
allocating a buffer, to explain that the type is FIXED_UDA_INTERMEDIATE


-- 
To view, visit http://gerrit.cloudera.org:8080/7526
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Ife90cf27989f98ffb5ef5c39f1e09ce92e8cb87c
Gerrit-PatchSet: 13
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-Owner: Tim Armstrong <[email protected]>
Gerrit-Reviewer: Dan Hecht <[email protected]>
Gerrit-Reviewer: Matthew Jacobs <[email protected]>
Gerrit-Reviewer: Michael Ho
Gerrit-Reviewer: Michael Ho <[email protected]>
Gerrit-Reviewer: Tim Armstrong <[email protected]>
Gerrit-HasComments: Yes

Reply via email to