Ted-Jiang opened a new pull request, #3146:
URL: https://github.com/apache/arrow-datafusion/pull/3146

   # Which issue does this PR close?
   
   
   Closes #3142, #3145 
   
   Now we support approx_percentile_cont(col_name, percentile value, number of 
histogram bins)
   
   ```
   DataFusion CLI v10.0.0
   ❯ create external table order stored as parquet location 
'/Users/yangjiang/test-data/tpch-1g/orders';
   0 rows in set. Query took 0.016 seconds.
   ❯ select o_orderstatus, approx_percentile_cont(o_totalprice, 0.5) from order 
group by o_orderstatus  order by 1 limit 3;
   +---------------+-------------------------------------------------------+
   | o_orderstatus | APPROXPERCENTILECONT(order.o_totalprice,Float64(0.5)) |
   +---------------+-------------------------------------------------------+
   | F             | 143415.09074751436                                    |
   | O             | 143177.55673372833                                    |
   | P             | 181407.62680871075                                    |
   +---------------+-------------------------------------------------------+
   3 rows in set. Query took 0.728 seconds.
   ❯ select o_orderstatus, approx_percentile_cont(o_totalprice, 0.5, 10000) 
from order group by o_orderstatus  order by 1 limit 3;
   
+---------------+--------------------------------------------------------------------+
   | o_orderstatus | 
APPROXPERCENTILECONT(order.o_totalprice,Float64(0.5),Int64(10000)) |
   
+---------------+--------------------------------------------------------------------+
   | F             | 143289.22569288642                                         
        |
   | O             | 143184.3388358634                                          
        |
   | P             | 181451.707578125                                           
        |
   
+---------------+--------------------------------------------------------------------+
   3 rows in set. Query took 1.168 seconds.
   ❯ 
   
   
   ```
   
    # Rationale for this change
   <!--
    Why are you proposing this change? If this is already explained clearly in 
the issue then this section is not needed.
    Explaining clearly why changes are proposed helps reviewers understand your 
changes and offer better suggestions for fixes.  
   -->
   
   # What changes are included in this PR?
   <!--
   There is no need to duplicate the description in the issue here but it is 
sometimes worth providing a summary of the individual changes in this PR.
   -->
   
   # Are there any user-facing changes?
   <!--
   If there are user-facing changes then we may require documentation to be 
updated before approving the PR.
   -->
   
   <!--
   If there are any breaking changes to public APIs, please add the `api 
change` label.
   -->


-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to