iemejia commented on code in PR #3514:
URL: https://github.com/apache/parquet-java/pull/3514#discussion_r3196488953
##########
parquet-column/src/main/java/org/apache/parquet/column/values/dictionary/DictionaryValuesWriter.java:
##########
@@ -246,8 +246,10 @@ public PlainBinaryDictionaryValuesWriter(
public void writeBytes(Binary v) {
int id = binaryDictionaryContent.getInt(v);
if (id == -1) {
- id = binaryDictionaryContent.size();
- binaryDictionaryContent.put(v.copy(), id);
+ id = dictionaryValues.size();
Review Comment:
@Fokko They should be equivalent because the map and ordered values list are
updated and cleared together. I used dictionaryValues.size() because the id is
the index into dictionaryValues, which is what dictionary-page writing and
fallback use. Using binaryDictionaryContent.size() would also work, but this
makes the indexing relationship explicit.
--
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]