wgtmac commented on a change in pull request #1067:
URL: https://github.com/apache/orc/pull/1067#discussion_r829663226
##########
File path: c++/src/ColumnWriter.cc
##########
@@ -139,10 +140,22 @@ namespace orc {
uint64_t offset,
uint64_t numValues,
const char* incomingMask) {
- notNullEncoder->add(batch.notNull.data() + offset, numValues,
incomingMask);
+ const char* notNull = batch.notNull.data() + offset;
+ notNullEncoder->add(notNull, numValues, incomingMask);
+ for (uint64_t i = 0; i < numValues; ++i) {
+ if (!notNull[i]) {
+ hasNullValue = true;
Review comment:
I'd suggest checking hasNullValue in line 145 or 146 because
hasNullValue may already be set by previous nulls.
##########
File path: c++/src/ByteRLE.cc
##########
@@ -203,6 +205,17 @@ namespace orc {
recorder->add(static_cast<uint64_t>(numLiterals));
}
+ void ByteRleEncoderImpl::suppress() {
+ // written data can be just ignored because they are only flushed in memory
+ outputStream->suppress();
+
+ numLiterals = 0;
Review comment:
Why not nullify buffer? I'd add a reset() function to clear the state
and use it here and in the ByteRleEncoderImpl constructor.
##########
File path: c++/src/ColumnWriter.cc
##########
@@ -139,10 +140,22 @@ namespace orc {
uint64_t offset,
uint64_t numValues,
const char* incomingMask) {
- notNullEncoder->add(batch.notNull.data() + offset, numValues,
incomingMask);
+ const char* notNull = batch.notNull.data() + offset;
+ notNullEncoder->add(notNull, numValues, incomingMask);
+ for (uint64_t i = 0; i < numValues; ++i) {
+ if (!notNull[i]) {
+ hasNullValue = true;
Review comment:
In addition, we should check batch.hasNulls as a shortcut.
--
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]