[ 
https://issues.apache.org/jira/browse/PHOENIX-6339?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17272427#comment-17272427
 ] 

ASF GitHub Bot commented on PHOENIX-6339:
-----------------------------------------

jpisaac commented on a change in pull request #1111:
URL: https://github.com/apache/phoenix/pull/1111#discussion_r564843145



##########
File path: phoenix-core/src/main/java/org/apache/phoenix/util/ScanUtil.java
##########
@@ -1304,21 +1304,20 @@ public static PagedFilter getPhoenixPagedFilter(Scan 
scan) {
      * each HBase RegionScanner#next() time which is controlled by PagedFilter 
is set to 0.3 * SERVER_PAGE_SIZE_MS.
      *
      */
-    private static long getPageSizeMs(Scan scan) {
+    private static long getPageSizeMs(Scan scan, double factor) {
         long pageSizeMs = Long.MAX_VALUE;
         byte[] pageSizeMsBytes = 
scan.getAttribute(BaseScannerRegionObserver.SERVER_PAGE_SIZE_MS);
         if (pageSizeMsBytes != null) {
             pageSizeMs = Bytes.toLong(pageSizeMsBytes);
+            pageSizeMs = (long) (pageSizeMs * factor);
         }
         return pageSizeMs;
     }
 
-    public static long getPageSizeMsForRegionScanner(Scan scan) {
-        return (long) (getPageSizeMs(scan) * 0.6);
-    }
+    public static long getPageSizeMsForRegionScanner(Scan scan)  { return 
getPageSizeMs(scan, 0.6); }

Review comment:
       What is/should be the thought process in choosing the factor? May be 
good to add some comments around it?




----------------------------------------------------------------
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:
us...@infra.apache.org


> Older client using aggregate queries shows incorrect results.
> -------------------------------------------------------------
>
>                 Key: PHOENIX-6339
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-6339
>             Project: Phoenix
>          Issue Type: Bug
>    Affects Versions: 5.1.0, 4.16.0
>            Reporter: Jacob Isaac
>            Assignee: Kadir OZDEMIR
>            Priority: Blocker
>             Fix For: 4.16.0
>
>
> When running an older client for eg (4.15) against a 4.16 server
> The output of aggregate queries are incorrect -
> expected one row with the count, actual 9 rows with counts.
> The 9 rows correspond to the number of regions in the data set. As shown in 
> the explain plan.
> Connected to: Phoenix (version 4.15)
> Driver: PhoenixEmbeddedDriver (version 4.15)
> Autocommit status: true
> Transaction isolation: TRANSACTION_READ_COMMITTED
> Building list of tables and columns for tab-completion (set fastconnect to 
> true to skip)...
> 225/225 (100%) Done
> Done
> sqlline version 1.5.0
> 0: jdbc:phoenix:localhost> select count(*) from 
> BENCHMARK.BM_AGGREGATION_TABLE_2;
> +-----------+
> | COUNT(1) |
> +-----------+
> | 2389483 |
> | 2319177 |
> | 1958007 |
> | 2389483 |
> | 2319178 |
> | 1958005 |
> | 2233646 |
> | 2249033 |
> | 2183988 |
> +-----------+
> 9 rows selected (6.56 seconds)
> 0: jdbc:phoenix:localhost> explain select count(*) from 
> BENCHMARK.BM_AGGREGATION_TABLE_2;
> +---------------------------------------------------------------------------------------------------------------+-----------------+----------------+----------------+
> | PLAN | EST_BYTES_READ | EST_ROWS_READ | EST_INFO_TS |
> +---------------------------------------------------------------------------------------------------------------+-----------------+----------------+----------------+
> | CLIENT 9-CHUNK 10191406 ROWS 1887436990 BYTES PARALLEL 1-WAY FULL SCAN OVER 
> BENCHMARK.BM_AGGREGATION_TABLE_2 | 1887436990 | 10191406 | 1611584394492 |
> | SERVER FILTER BY FIRST KEY ONLY | 1887436990 | 10191406 | 1611584394492 |
> | SERVER AGGREGATE INTO SINGLE ROW | 1887436990 | 10191406 | 1611584394492 |
> +---------------------------------------------------------------------------------------------------------------+-----------------+----------------+----------------+



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to