vrozov commented on a change in pull request #1387: DRILL-6603: Set num_nulls
for parquet statistics to -1 when actual number is not defined.
URL: https://github.com/apache/drill/pull/1387#discussion_r203763410
##########
File path:
exec/java-exec/src/main/java/org/apache/drill/exec/store/parquet/metadata/Metadata.java
##########
@@ -447,47 +446,40 @@ private ParquetFileMetadata_v3
getParquetFileMetadata_v3(ParquetTableMetadata_v3
logger.debug(containsCorruptDates.toString());
}
for (BlockMetaData rowGroup : metadata.getBlocks()) {
- List<ColumnMetadata_v3> columnMetadataList = Lists.newArrayList();
+ List<ColumnMetadata_v3> columnMetadataList = new ArrayList<>();
long length = 0;
for (ColumnChunkMetaData col : rowGroup.getColumns()) {
- ColumnMetadata_v3 columnMetadata;
-
- boolean statsAvailable = (col.getStatistics() != null &&
!col.getStatistics().isEmpty());
-
Statistics<?> stats = col.getStatistics();
String[] columnName = col.getPath().toArray();
SchemaPath columnSchemaName = SchemaPath.getCompoundPath(columnName);
ColTypeInfo colTypeInfo = colTypeInfoMap.get(columnSchemaName);
ColumnTypeMetadata_v3 columnTypeMetadata =
- new ColumnTypeMetadata_v3(columnName, col.getType(),
colTypeInfo.originalType,
+ new ColumnTypeMetadata_v3(columnName,
col.getPrimitiveType().getPrimitiveTypeName(), colTypeInfo.originalType,
colTypeInfo.precision, colTypeInfo.scale,
colTypeInfo.repetitionLevel, colTypeInfo.definitionLevel);
if (parquetTableMetadata.columnTypeInfo == null) {
parquetTableMetadata.columnTypeInfo = new ConcurrentHashMap<>();
}
+ parquetTableMetadata.columnTypeInfo.put(new
ColumnTypeMetadata_v3.Key(columnTypeMetadata.name), columnTypeMetadata);
+
// Save the column schema info. We'll merge it into one list
- parquetTableMetadata.columnTypeInfo
- .put(new ColumnTypeMetadata_v3.Key(columnTypeMetadata.name),
columnTypeMetadata);
+ Object minValue = null;
+ Object maxValue = null;
+ long numNulls = -1;
+ boolean statsAvailable = stats != null && !stats.isEmpty();
if (statsAvailable) {
- // Write stats when they are not null
- Object minValue = null;
- Object maxValue = null;
if (stats.hasNonNullValue()) {
minValue = stats.genericGetMin();
maxValue = stats.genericGetMax();
- if (containsCorruptDates ==
ParquetReaderUtility.DateCorruptionStatus.META_SHOWS_CORRUPTION
- && columnTypeMetadata.originalType == OriginalType.DATE) {
+ if (containsCorruptDates ==
ParquetReaderUtility.DateCorruptionStatus.META_SHOWS_CORRUPTION &&
columnTypeMetadata.originalType == OriginalType.DATE) {
Review comment:
Please avoid changes that affect only code formatting unless there is
something wrong with the code style. In this particular case, the new code
violates Drill code style "Line length limit is 120 chars, instead of 80 chars."
----------------------------------------------------------------
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