SavicStefan commented on code in PR #59669:
URL: https://github.com/apache/spark/pull/59669#discussion_r4400869064


##########
common/variant/src/main/java/org/apache/spark/types/variant/VariantBuilder.java:
##########


Review Comment:
   For me I would keep `isCanonical` as a fast path, because like it can avoid 
rebuilding already canonical inputs, including ordinary `parse_json` results 
and its benefits isn’t limited to repeated/nested group by. 
   
   About collecting keys in `isCanonical` it would add allocations even when no 
rebuild is needed, also it would also require walking the entire value after 
finding a noncanonical encoding. Keeping key collection separate lets the check 
stop early and collects keys only when we need to rebuild.
   
   cc @gene-db 
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to