Skip to content

ORC-443: [C++] Code improvements in ColumnWriter.#344

Merged
wgtmac merged 4 commits intoapache:masterfrom
fangzheng:orc-443
Dec 3, 2018
Merged

ORC-443: [C++] Code improvements in ColumnWriter.#344
wgtmac merged 4 commits intoapache:masterfrom
fangzheng:orc-443

Conversation

@fangzheng
Copy link
Copy Markdown
Contributor

  1. in add() function, re-order code to verify input parameters before modifying any internal state.

  2. in add() function, move the calls to colIndexStatistics->increase(1) out of the loop.

@fangzheng fangzheng changed the title [C++] Code improvements in ColumnWriter. ORC-443: [C++] Code improvements in ColumnWriter. Nov 30, 2018
Copy link
Copy Markdown
Member

@wgtmac wgtmac left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall LGTM, only some small styling changes are needed. Thanks!

/**
* Flushing underlying BufferedOutputStream
* Flush underlying BufferedOutputStream.
*/
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please also align this line

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.


DoubleColumnStatisticsImpl* doubleStats =
dynamic_cast<DoubleColumnStatisticsImpl*>(colIndexStatistics.get());
dynamic_cast<DoubleColumnStatisticsImpl*>(colIndexStatistics.get());
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please use same indent

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

const int64_t* values = decBatch->values.data() + offset;
DecimalColumnStatisticsImpl* decStats =
dynamic_cast<DecimalColumnStatisticsImpl*>(colIndexStatistics.get());
dynamic_cast<DecimalColumnStatisticsImpl*>(colIndexStatistics.get());
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here and below

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@fangzheng
Copy link
Copy Markdown
Contributor Author

Thanks, Gang! All the codes are fixed now.

Copy link
Copy Markdown
Member

@wgtmac wgtmac left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @fangzheng ! I will merge this and your previous one next week in case someone else wants to review.

@majetideepak
Copy link
Copy Markdown
Contributor

@fangzheng can you please resolve the conflict? Thanks.

@fangzheng
Copy link
Copy Markdown
Contributor Author

@majetideepak Hi Deepak, the conflicts have been resolved. Thanks.

@wgtmac wgtmac merged commit 3f0ee8d into apache:master Dec 3, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants