vvysotskyi commented on a change in pull request #1406: DRILL-6641: Fix
columnValueCounts in ParquetGroupScanStatistics when ParquetGroupScan has
RowGroupInfo without column statistics
URL: https://github.com/apache/drill/pull/1406#discussion_r206145290
##########
File path:
exec/java-exec/src/main/java/org/apache/drill/exec/store/parquet/ParquetGroupScanStatistics.java
##########
@@ -88,19 +88,14 @@ public void collect(List<RowGroupInfo> rowGroupInfos,
ParquetTableMetadataBase p
for (ColumnMetadata column : rowGroup.getColumns()) {
SchemaPath schemaPath = SchemaPath.getCompoundPath(column.getName());
Long previousCount = columnValueCounts.get(schemaPath);
- if (previousCount != null) {
- if (previousCount != GroupScan.NO_COLUMN_STATS &&
column.isNumNullsSet()) {
- Long newCount = rowCount - column.getNulls();
- columnValueCounts.put(schemaPath,
columnValueCounts.get(schemaPath) + newCount);
- }
+ previousCount = previousCount == null ? 0 : previousCount;
Review comment:
@vrozov, changed the code to use `MutableLong`.
I appreciate the proposal to improve my code, but this optimization does not
bring an essential performance increase. The previous code was not so bad and
indeed it was better than before the changes and the main thing that it fixes
the bug without breaking anything.
During the time we have this conversation, we might fix more bugs or do more
useful things for the project. In the future, I would recommend concentrating
on the approach, checking that the code will still work as expected, rather
than on such minor things.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services