wgtmac commented on code in PR #33910:
URL: https://github.com/apache/arrow/pull/33910#discussion_r1091297068
##########
cpp/src/parquet/encoding.cc:
##########
@@ -649,15 +649,15 @@ class DictEncoderImpl : public EncoderImpl, virtual
public DictEncoder<DType> {
};
template <typename DType>
-void DictEncoderImpl<DType>::WriteDict(uint8_t* buffer) {
+void DictEncoderImpl<DType>::WriteDict(uint8_t* buffer) const {
Review Comment:
> I'm not 100% sure on the C++ conventions here, but I'm not sure I agree
this should be labelled `const`. We are modifying `memo_table_`, right? And
probably doing so in a way that wouldn't be safe to call from multiple threads
concurrently?
>
> @lidavidm Am I wrong on this?
We are not modifying memo_table_ here. Instead this function copies all
values from memo_table_ to the output buffer. It is read-only and doesn’t
change anything.
I’m not sure when it will be called concurrently.
In my context, the dict encoder is called to collect and aggregate
dictionary entries of all row groups in a parquet writer. Finally it outputs
the aggregated dictionary in a const function. So it makes sense to me to label
it as const.
@lidavidm @wjones127
--
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]