[
https://issues.apache.org/jira/browse/HIVE-26221?focusedWorklogId=832850&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-832850
]
ASF GitHub Bot logged work on HIVE-26221:
-----------------------------------------
Author: ASF GitHub Bot
Created on: 12/Dec/22 19:00
Start Date: 12/Dec/22 19:00
Worklog Time Spent: 10m
Work Description: amansinha100 commented on code in PR #3137:
URL: https://github.com/apache/hive/pull/3137#discussion_r1046254845
##########
ql/src/test/results/clientpositive/beeline/colstats_all_nulls.q.out:
##########
@@ -73,6 +74,7 @@ max_col_len
num_trues
num_falses
bit_vector HL
+histogram
Review Comment:
> If we were to implement this, would you show/hide the histogram line for
the DESCRIBE FORMATTED command based on the value of metastore.stats.fetch.kll
alone?
When I made the comment I was not thinking about the metastore flag but
yeah, if we were to do this it would make sense to make it conditional on
metastore.stats.fetch.kll alone.
While I understand that displaying it makes it consistent with bit_vector
and I see your point about the fact that for bit_vector it was displayed from
the start, I think that histograms/KLL are more advanced stats and it needs a
little bit of time to 'bake' in both in terms of the code and usability. I am
also trying to see if we can reduce the number of q.out changes within a single
patch especially since these q.out files have empty histogram stats. Instead,
if we can have a follow up to add this, it would simplify things a bit. It
would also be useful to get additional opinions on this. @dengzhhu653
@kasakrisz any thoughts ?
Issue Time Tracking
-------------------
Worklog Id: (was: 832850)
Time Spent: 10h 40m (was: 10.5h)
> Add histogram-based column statistics
> -------------------------------------
>
> Key: HIVE-26221
> URL: https://issues.apache.org/jira/browse/HIVE-26221
> Project: Hive
> Issue Type: Improvement
> Components: CBO, Metastore, Statistics
> Affects Versions: 4.0.0-alpha-2
> Reporter: Alessandro Solimando
> Assignee: Alessandro Solimando
> Priority: Major
> Labels: pull-request-available
> Time Spent: 10h 40m
> Remaining Estimate: 0h
>
> Hive does not support histogram statistics, which are particularly useful for
> skewed data (which is very common in practice) and range predicates.
> Hive's current selectivity estimation for range predicates is based on a
> hard-coded value of 1/3 (see
> [FilterSelectivityEstimator.java#L138-L144|https://github.com/apache/hive/blob/56c336268ea8c281d23c22d89271af37cb7e2572/ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/stats/FilterSelectivityEstimator.java#L138-L144]).])
> The current proposal aims at integrating histogram as an additional column
> statistics, stored into the Hive metastore at the table (or partition) level.
> The main requirements for histogram integration are the following:
> * efficiency: the approach must scale and support billions of rows
> * merge-ability: partition-level histograms have to be merged to form
> table-level histograms
> * explicit and configurable trade-off between memory footprint and accuracy
> Hive already integrates [KLL data
> sketches|https://datasketches.apache.org/docs/KLL/KLLSketch.html] UDAF.
> Datasketches are small, stateful programs that process massive data-streams
> and can provide approximate answers, with mathematical guarantees, to
> computationally difficult queries orders-of-magnitude faster than
> traditional, exact methods.
> We propose to use KLL, and more specifically the cumulative distribution
> function (CDF), as the underlying data structure for our histogram statistics.
> The current proposal targets numeric data types (float, integer and numeric
> families) and temporal data types (date and timestamp).
--
This message was sent by Atlassian Jira
(v8.20.10#820010)