paul-rogers commented on a change in pull request #1985: DRILL-7565: ANALYZE
TABLE ... REFRESH METADATA does not work for empty Parquet files
URL: https://github.com/apache/drill/pull/1985#discussion_r379850255
##########
File path:
exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/metadata/MetadataAggregateHelper.java
##########
@@ -313,8 +317,19 @@ private void addColumnAggregateCalls(FieldReference
fieldRef, String fieldName)
if (interestingColumns == null || interestingColumns.contains(fieldRef))
{
// collect statistics for all or only interesting columns if they are
specified
AnalyzeColumnUtils.COLUMN_STATISTICS_FUNCTIONS.forEach((statisticsKind,
sqlKind) -> {
+ // constructs "case when is not null projectMetadataColumn then
column1 else null end" call
+ // to avoid using default values for required columns when data for
empty result is obtained
Review comment:
Just FYI: a clever thing Impala does is to use just plain SQL to gather
stats. Then, logic such as this is expressed in the SQL for the stats query. I
think Impala has a few functions specifically for stats gathering, such as NDV
estimates, etc.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services