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

Tomas Farkas commented on KUDU-2463:
------------------------------------

Hi, unfortunately I have dropped the incorrect day and recalculated it.
But I have a new day, with similar behaviour, select count(*) returns ok, but 
selecting count(*) with group by on multiple ranges, returns BAD result.


{{[10.197.0.164:21000] > SELECT created_date, COUNT(*) FROM base.usage_kudu 
WHERE created_date = 20180527 GROUP BY created_date order by 1;}}
{{Query: SELECT created_date, COUNT(*) FROM base.usage_kudu WHERE created_date 
= 20180527 GROUP BY created_date order by 1}}
{{Query submitted at: 2018-06-05 20:54:26 (Coordinator: 
http://ip-10-197-0-164.eu-west-1.compute.internal:25000)}}
{{Query progress can be monitored at: 
http://ip-10-197-0-164.eu-west-1.compute.internal:25000/query_plan?query_id=50490dab2290c37c:31a6c30500000000}}
{{+--------------+----------+}}
{{| created_date | count(*) |}}
{{+--------------+----------+}}
{{| 20180527 | 14939691 |}}
{{+--------------+----------+}}
{{Fetched 1 row(s) in 0.36s}}
{{[10.197.0.164:21000] > SELECT created_date, COUNT(*) FROM base.usage_kudu 
WHERE created_date = 20180527 GROUP BY created_date;}}
{{Query: SELECT created_date, COUNT(*) FROM base.usage_kudu WHERE created_date 
= 20180527 GROUP BY created_date}}
{{Query submitted at: 2018-06-05 20:54:31 (Coordinator: 
http://ip-10-197-0-164.eu-west-1.compute.internal:25000)}}
{{Query progress can be monitored at: 
http://ip-10-197-0-164.eu-west-1.compute.internal:25000/query_plan?query_id=2b493792dd987c7f:7926aba700000000}}
{{+--------------+----------+}}
{{| created_date | count(*) |}}
{{+--------------+----------+}}
{{| 20180527 | 14939691 |}}
{{+--------------+----------+}}
{{Fetched 1 row(s) in 0.27s}}
{{[10.197.0.164:21000] > EXPLAIN SELECT created_date, COUNT(*) FROM 
base.usage_kudu WHERE created_date = 20180527 GROUP BY created_date;}}
{{Query: EXPLAIN SELECT created_date, COUNT(*) FROM base.usage_kudu WHERE 
created_date = 20180527 GROUP BY created_date}}
{{+--------------------------------------------------+}}
{{| Explain String |}}
{{+--------------------------------------------------+}}
{{| Max Per-Host Resource Reservation: Memory=3.94MB |}}
{{| Per-Host Resource Estimates: Memory=20.00MB |}}
{{| |}}
{{| PLAN-ROOT SINK |}}
{{| | |}}
{{| 04:EXCHANGE [UNPARTITIONED] |}}
{{| | |}}
{{| 03:AGGREGATE [FINALIZE] |}}
{{| | output: count:merge(*) |}}
{{| | group by: created_date |}}
{{| | |}}
{{| 02:EXCHANGE [HASH(created_date)] |}}
{{| | |}}
{{| 01:AGGREGATE [STREAMING] |}}
{{| | output: count(*) |}}
{{| | group by: created_date |}}
{{| | |}}
{{| 00:SCAN KUDU [base.usage_kudu] |}}
{{| kudu predicates: created_date = 20180527 |}}
{{+--------------------------------------------------+}}
{{Fetched 19 row(s) in 0.04s}}
{{[10.197.0.164:21000] > EXPLAIN SELECT created_date, COUNT(*) FROM 
base.usage_kudu WHERE created_date = 20180527 GROUP BY created_date ORDER BY 
1;}}
{{Query: EXPLAIN SELECT created_date, COUNT(*) FROM base.usage_kudu WHERE 
created_date = 20180527 GROUP BY created_date ORDER BY 1}}
{{+--------------------------------------------------+}}
{{| Explain String |}}
{{+--------------------------------------------------+}}
{{| Max Per-Host Resource Reservation: Memory=9.94MB |}}
{{| Per-Host Resource Estimates: Memory=26.00MB |}}
{{| |}}
{{| PLAN-ROOT SINK |}}
{{| | |}}
{{| 05:MERGING-EXCHANGE [UNPARTITIONED] |}}
{{| | order by: created_date ASC |}}
{{| | |}}
{{| 02:SORT |}}
{{| | order by: created_date ASC |}}
{{| | |}}
{{| 04:AGGREGATE [FINALIZE] |}}
{{| | output: count:merge(*) |}}
{{| | group by: created_date |}}
{{| | |}}
{{| 03:EXCHANGE [HASH(created_date)] |}}
{{| | |}}
{{| 01:AGGREGATE [STREAMING] |}}
{{| | output: count(*) |}}
{{| | group by: created_date |}}
{{| | |}}
{{| 00:SCAN KUDU [base.usage_kudu] |}}
{{| kudu predicates: created_date = 20180527 |}}
{{+--------------------------------------------------+}}
{{Fetched 23 row(s) in 0.04s}}
{{[10.197.0.164:21000] > SELECT created_date, COUNT(*) FROM base.usage_kudu 
WHERE created_date >= 20180527 GROUP BY created_date ORDER BY 1;}}
{{Query: SELECT created_date, COUNT(*) FROM base.usage_kudu WHERE created_date 
>= 20180527 GROUP BY created_date ORDER BY 1}}
{{Query submitted at: 2018-06-05 20:55:09 (Coordinator: 
http://ip-10-197-0-164.eu-west-1.compute.internal:25000)}}
{{Query progress can be monitored at: 
http://ip-10-197-0-164.eu-west-1.compute.internal:25000/query_plan?query_id=a5447f235f560160:17c2c0db00000000}}
{{+--------------+----------+}}
{{| created_date | count(*) |}}
{{+--------------+----------+}}
{{| 20180527 | 14961576 | <- WRONG}}
{{| 20180528 | 17607943 |}}
{{| 20180529 | 20741097 |}}
{{| 20180530 | 15627090 |}}
{{| 20180531 | 16877228 |}}
{{| 20180601 | 17881253 |}}
{{| 20180602 | 13325080 |}}
{{| 20180603 | 12145131 |}}
{{| 20180604 | 3849504 |}}
{{+--------------+----------+}}
{{Fetched 9 row(s) in 0.61s}}
{{[10.197.0.164:21000] > SELECT created_date, COUNT(*) FROM base.usage_kudu 
WHERE created_date >= 20180526 GROUP BY created_date ORDER BY 1;}}
{{Query: SELECT created_date, COUNT(*) FROM base.usage_kudu WHERE created_date 
>= 20180526 GROUP BY created_date ORDER BY 1}}
{{Query submitted at: 2018-06-05 20:55:28 (Coordinator: 
http://ip-10-197-0-164.eu-west-1.compute.internal:25000)}}
{{Query progress can be monitored at: 
http://ip-10-197-0-164.eu-west-1.compute.internal:25000/query_plan?query_id=af477c731c1aad1f:a09e16d300000000}}
{{+--------------+----------+}}
{{| created_date | count(*) |}}
{{+--------------+----------+}}
{{| 20180526 | 15268520 |}}
{{| 20180527 | 14939691 |}}
{{| 20180528 | 17607943 |}}
{{| 20180529 | 20741097 |}}
{{| 20180530 | 17362364 |}}
{{| 20180531 | 16903829 |}}
{{| 20180601 | 17881253 |}}
{{| 20180602 | 13325080 |}}
{{| 20180603 | 12145131 |}}
{{| 20180604 | 3849504 |}}
{{+--------------+----------+}}
{{Fetched 10 row(s) in 0.57s}}
{{[10.197.0.164:21000] >}}{{Fetched 9 row(s) in 0.76s}}
{{[10.197.0.164:21000] > SELECT created_date, COUNT(*) FROM base.usage_kudu 
WHERE created_date >= 20180527 and created_date < 20180529 GROUP BY 
created_date ORDER BY 1;}}
{{Query: SELECT created_date, COUNT(*) FROM base.usage_kudu WHERE created_date 
>= 20180527 and created_date < 20180529 GROUP BY created_date ORDER BY 1}}
{{Query submitted at: 2018-06-05 20:57:23 (Coordinator: 
http://ip-10-197-0-164.eu-west-1.compute.internal:25000)}}
{{Query progress can be monitored at: 
http://ip-10-197-0-164.eu-west-1.compute.internal:25000/query_plan?query_id=e446787206dddc1a:bc20aad00000000}}
{{+--------------+----------+}}
{{| created_date | count(*) |}}
{{+--------------+----------+}}
{{| 20180527 | 14961576 |}}
{{| 20180528 | 17607943 |}}
{{+--------------+----------+}}
{{Fetched 2 row(s) in 0.28s}}
{{[10.197.0.164:21000] > SELECT created_date, COUNT(*) FROM base.usage_kudu 
WHERE created_date >= 20180527 and created_date < 20180528 GROUP BY 
created_date ORDER BY 1;}}
{{Query: SELECT created_date, COUNT(*) FROM base.usage_kudu WHERE created_date 
>= 20180527 and created_date < 20180528 GROUP BY created_date ORDER BY 1}}
{{Query submitted at: 2018-06-05 20:57:28 (Coordinator: 
http://ip-10-197-0-164.eu-west-1.compute.internal:25000)}}
{{Query progress can be monitored at: 
http://ip-10-197-0-164.eu-west-1.compute.internal:25000/query_plan?query_id=584e979c1eff23bd:c430144700000000}}
{{+--------------+----------+}}
{{| created_date | count(*) |}}
{{+--------------+----------+}}
{{| 20180527 | 14939691 |}}
{{+--------------+----------+}}
{{Fetched 1 row(s) in 0.27s}}


Correct number for 27.5.2018 is 14939691.

Kudu Table info:

{{impala::base.usage_kudu cabb6be5e7ad433eb71db1cc3fc5a666 Running Current 
schema version=0}}{{HASH ( banid, subs, cdate, ctime, swid, msgid, bseq) 
PARTITIONS 10,}}
{{RANGE (created_date) (}}
{{ PARTITION 20180101 <= VALUES < 20180102,}}
{{ PARTITION 20180401 <= VALUES < 20180402,}}
{{ PARTITION 20180402 <= VALUES < 20180403,}}
{{ PARTITION 20180403 <= VALUES < 20180404,}}
{{ PARTITION 20180404 <= VALUES < 20180405,}}
{{ PARTITION 20180405 <= VALUES < 20180406,}}
{{ PARTITION 20180406 <= VALUES < 20180407,}}
{{ PARTITION 20180407 <= VALUES < 20180408,}}
{{ PARTITION 20180408 <= VALUES < 20180409,}}
{{ PARTITION 20180409 <= VALUES < 20180410,}}
{{ PARTITION 20180410 <= VALUES < 20180411,}}
{{ PARTITION 20180411 <= VALUES < 20180412,}}
{{ PARTITION 20180412 <= VALUES < 20180413,}}
{{ PARTITION 20180413 <= VALUES < 20180414,}}
{{ PARTITION 20180414 <= VALUES < 20180415,}}
{{ PARTITION 20180415 <= VALUES < 20180416,}}
{{ PARTITION 20180416 <= VALUES < 20180417,}}
{{ PARTITION 20180417 <= VALUES < 20180418,}}
{{ PARTITION 20180418 <= VALUES < 20180419,}}
{{ PARTITION 20180419 <= VALUES < 20180420,}}
{{ PARTITION 20180420 <= VALUES < 20180421,}}
{{ PARTITION 20180421 <= VALUES < 20180422,}}
{{ PARTITION 20180422 <= VALUES < 20180423,}}
{{ PARTITION 20180423 <= VALUES < 20180424,}}
{{ PARTITION 20180424 <= VALUES < 20180425,}}
{{ PARTITION 20180425 <= VALUES < 20180426,}}
{{ PARTITION 20180426 <= VALUES < 20180427,}}
{{ PARTITION 20180427 <= VALUES < 20180428,}}
{{ PARTITION 20180428 <= VALUES < 20180429,}}
{{ PARTITION 20180429 <= VALUES < 20180430,}}
{{ PARTITION 20180430 <= VALUES < 20180431,}}
{{ PARTITION 20180501 <= VALUES < 20180502,}}
{{ PARTITION 20180502 <= VALUES < 20180503,}}
{{ PARTITION 20180503 <= VALUES < 20180504,}}
{{ PARTITION 20180504 <= VALUES < 20180505,}}
{{ PARTITION 20180505 <= VALUES < 20180506,}}
{{ PARTITION 20180506 <= VALUES < 20180507,}}
{{ PARTITION 20180507 <= VALUES < 20180508,}}
{{ PARTITION 20180508 <= VALUES < 20180509,}}
{{ PARTITION 20180509 <= VALUES < 20180510,}}
{{ PARTITION 20180510 <= VALUES < 20180511,}}
{{ PARTITION 20180511 <= VALUES < 20180512,}}
{{ PARTITION 20180512 <= VALUES < 20180513,}}
{{ PARTITION 20180513 <= VALUES < 20180514,}}
{{ PARTITION 20180514 <= VALUES < 20180515,}}
{{ PARTITION 20180515 <= VALUES < 20180516,}}
{{ PARTITION 20180516 <= VALUES < 20180517,}}
{{ PARTITION 20180517 <= VALUES < 20180518,}}
{{ PARTITION 20180518 <= VALUES < 20180519,}}
{{ PARTITION 20180519 <= VALUES < 20180520,}}
{{ PARTITION 20180520 <= VALUES < 20180521,}}
{{ PARTITION 20180521 <= VALUES < 20180522,}}
{{ PARTITION 20180522 <= VALUES < 20180523,}}
{{ PARTITION 20180523 <= VALUES < 20180524,}}
{{ PARTITION 20180524 <= VALUES < 20180525,}}
{{ PARTITION 20180525 <= VALUES < 20180526,}}
{{ PARTITION 20180526 <= VALUES < 20180527,}}
{{ PARTITION 20180527 <= VALUES < 20180528,}}
{{ PARTITION 20180528 <= VALUES < 20180529,}}
{{ PARTITION 20180529 <= VALUES < 20180530,}}
{{ PARTITION 20180530 <= VALUES < 20180531,}}
{{ PARTITION 20180531 <= VALUES < 20180532,}}
{{ PARTITION 20180601 <= VALUES < 20180602,}}
{{ PARTITION 20180602 <= VALUES < 20180603,}}
{{ PARTITION 20180603 <= VALUES < 20180604,}}
{{ PARTITION 20180604 <= VALUES < 20180605,}}
{{ PARTITION 20180605 <= VALUES < 20180606,}}
{{ PARTITION 20180606 <= VALUES < 20180607,}}
{{ PARTITION 20180607 <= VALUES < 20180608}}
{{)}}
{{Column ID Type Encoding Compression Read default Write default}}
{{banid 0 int64 NOT NULL AUTO_ENCODING DEFAULT_COMPRESSION - -}}
{{subs 1 string NOT NULL AUTO_ENCODING DEFAULT_COMPRESSION - -}}
{{cdate 2 string NOT NULL AUTO_ENCODING DEFAULT_COMPRESSION - -}}
{{ctime 3 string NOT NULL AUTO_ENCODING DEFAULT_COMPRESSION - -}}
{{swid 4 string NOT NULL AUTO_ENCODING DEFAULT_COMPRESSION - -}}
{{msgid 5 string NOT NULL AUTO_ENCODING DEFAULT_COMPRESSION - -}}
{{bseq 6 int32 NOT NULL AUTO_ENCODING DEFAULT_COMPRESSION - -}}
{{created_date 7 int32 NOT NULL AUTO_ENCODING DEFAULT_COMPRESSION - -}}
{{and 70+ columns}}


I noticed that the definition of PK on the Kudu web ui does not contain the 
range column.
But I am quite sure, that it was there, because I have the original DDL which 
defined table and the PK like this:

{{CREATE TABLE base.usage_kudu ( }}
{{...}}
{{PRIMARY KEY (banid, subs, cdate, ctime, swid, msgid, bseq, created_date) ) }}
{{PARTITION BY HASH (banid, subs, cdate, ctime, swid, msgid, bseq) PARTITIONS 
10, RANGE (created_date) ( PARTITION VALUE=(20180101) ) STORED AS KUDU;}}


I checked the Details section for value 20180527, looks normal:

{{1da338dd856b4cb8ac67d1430e533134 0 20180526 <= VALUES < 20180527 Running 
Tablet reported with an active leader }}
{{LEADER: ip-10-197-0-164.eu-west-1.compute.internal:8050}}
{{FOLLOWER: ip-10-197-15-82.eu-west-1.compute.internal:8050}}
{{FOLLOWER: ip-10-197-22-10.eu-west-1.compute.internal:8050}}
{{4c4d158c96c64c04b13973c26cd5f7a6 0 20180527 <= VALUES < 20180528 Running 
Tablet reported with an active leader }}
{{LEADER: ip-10-197-18-181.eu-west-1.compute.internal:8050}}
{{FOLLOWER: ip-10-197-24-141.eu-west-1.compute.internal:8050}}
{{FOLLOWER: ip-10-197-27-68.eu-west-1.compute.internal:8050}}
{{... plus all the other 9 partitions}}

 

> Different results returned by group by on count() metric
> --------------------------------------------------------
>
>                 Key: KUDU-2463
>                 URL: https://issues.apache.org/jira/browse/KUDU-2463
>             Project: Kudu
>          Issue Type: Bug
>          Components: impala
>    Affects Versions: 1.5.0
>            Reporter: Tomas Farkas
>            Priority: Critical
>
> Hi, 
> I have a static table in Kudu, no inserts/updates or deletes are running on 
> the cluster. The query returns DIFFERENT result when I change the where 
> condition on one of the primary key columns, which is in the group_by list.
> The created_date is part of the PK and is type of int.
> PK contains subscriber, time, date, identifier and created_date.
> I tried to check if the inserted count is equal to the HDFS table, and 
> noticed on one day, that the count differs based on the where criteria!!
> {quote} 
> {{[10.197.0.164:21000] > select created_date, count(*) from base.usage_kudu 
> where created_date >= 20180601 group by created_date;}}
>  {{Query: select created_date, count(*) from base.usage_kudu where 
> created_date >= 20180601 group by created_date}}
>  {{Query submitted at: 2018-06-04 21:06:30 (Coordinator: 
> [http://ip-10-197-0-164.eu-west-1.compute.internal:25000|http://ip-10-197-0-164.eu-west-1.compute.internal:25000/])}}
>  {{Query progress can be monitored at: 
> [http://ip-10-197-0-164.eu-west-1.compute.internal:25000/query_plan?query_id=ce4e92eda5aaa02f:ea07aa4600000000]}}
>  {{+---------------+---------+}}
>  {{| created_date | count(*) |}}
>  {{+---------------+---------+}}
>  {{| 20180603 | 12145131 |}}
>  {{| 20180601 | 18076448 | -> 195k MORE!!!}}
>  {{| 20180602 | 13325080 |}}
>  {{| 20180604 | 3788161 |}}
>  {{+---------------+---------+}}
>  {{Fetched 4 row(s) in 0.37s}}
>  {{[10.197.0.164:21000] >}}
>  {{[10.197.0.164:21000] >}}
>  {{[10.197.0.164:21000] > select created_date, count(*) from base.usage_kudu 
> where created_date >= 20180601 group by created_date order by 1;}}
>  {{Query: select created_date, count(*) from base.usage_kudu where 
> created_date >= 20180601 group by created_date order by 1}}
>  {{Query submitted at: 2018-06-04 21:06:55 (Coordinator: 
> [http://ip-10-197-0-164.eu-west-1.compute.internal:25000|http://ip-10-197-0-164.eu-west-1.compute.internal:25000/])}}
>  {{Query progress can be monitored at: 
> [http://ip-10-197-0-164.eu-west-1.compute.internal:25000/query_plan?query_id=d541a9dda19e28e4:be4a2ca000000000]}}
>  {{+---------------+---------+}}
>  {{| created_date | count(*) |}}
>  {{+---------------+---------+}}
>  {{| 20180601 | 18076448 | -> 195k MORE!!!}}
>  {{| 20180602 | 13325080 |}}
>  {{| 20180603 | 12145131 |}}
>  {{| 20180604 | 3788161 |}}
>  {{+---------------+---------+}}
>  {{Fetched 4 row(s) in 1.14s}}
>  {{[10.197.0.164:21000] > select created_date, count(*) from base.usage_kudu 
> where created_date >= 20180528 group by created_date order by 1;}}
>  {{Query: select created_date, count(*) from base.usage_kudu where 
> created_date >= 20180528 group by created_date order by 1}}
>  {{Query submitted at: 2018-06-04 21:07:12 (Coordinator: 
> [http://ip-10-197-0-164.eu-west-1.compute.internal:25000|http://ip-10-197-0-164.eu-west-1.compute.internal:25000/])}}
>  {{Query progress can be monitored at: 
> [http://ip-10-197-0-164.eu-west-1.compute.internal:25000/query_plan?query_id=774a261fb94ad2bb:aab28b8b00000000]}}
>  {{+---------------+---------+}}
>  {{| created_date | count(*) |}}
>  {{+---------------+---------+}}
>  {{| 20180528 | 17607943 |}}
>  {{| 20180529 | 20741097 |}}
>  {{| 20180530 | 17362364 |}}
>  {{| 20180531 | 16877228 |}}
>  \{{| 20180601 | 17925671 | -> 44k MORE!! }}
>  {{| 20180602 | 13325080 |}}
>  {{| 20180603 | 12145131 |}}
>  {{| 20180604 | 3788161 |}}
>  {{+---------------+---------+}}
>  {{Fetched 8 row(s) in 0.67s}}
>  {{[10.197.0.164:21000] > select created_date, count(*) from base.usage_kudu 
> where created_date >= 20180525 group by created_date order by 1;}}
>  {{Query: select created_date, count(*) from base.usage_kudu where 
> created_date >= 20180525 group by created_date order by 1}}
>  {{Query submitted at: 2018-06-04 21:07:25 (Coordinator: 
> [http://ip-10-197-0-164.eu-west-1.compute.internal:25000|http://ip-10-197-0-164.eu-west-1.compute.internal:25000/])}}
>  {{Query progress can be monitored at: 
> [http://ip-10-197-0-164.eu-west-1.compute.internal:25000/query_plan?query_id=38483ad3ae5c8eb9:a538cb6300000000]}}
>  {{+---------------+---------+}}
>  {{| created_date | count(*) |}}
>  {{+---------------+---------+}}
>  {{| 20180525 | 22309857 |}}
>  {{| 20180526 | 15268520 |}}
>  {{| 20180527 | 14939691 |}}
>  {{| 20180528 | 17607943 |}}
>  {{| 20180529 | 20741097 |}}
>  {{| 20180530 | 17362364 |}}
>  {{| 20180531 | 16903829 |}}
>  {{| 20180601 | 18047010 | -> 165k MORE!!!}}
>  {{| 20180602 | 13325080 |}}
>  {{| 20180603 | 12145131 |}}
>  {{| 20180604 | 3788161 |}}
>  {{+---------------+---------+}}
>  {{Fetched 11 row(s) in 0.85s}}
>  {{[10.197.0.164:21000] > select created_date, count(*) from base.usage_kudu 
> where created_date = 20180601 group by created_date;}}
>  {{Query: select created_date, count(*) from base.usage_kudu where 
> created_date = 20180601 group by created_date}}
>  {{Query submitted at: 2018-06-04 21:07:42 (Coordinator: 
> [http://ip-10-197-0-164.eu-west-1.compute.internal:25000|http://ip-10-197-0-164.eu-west-1.compute.internal:25000/])}}
>  {{Query progress can be monitored at: 
> [http://ip-10-197-0-164.eu-west-1.compute.internal:25000/query_plan?query_id=7343ba31f6b4c86f:621a7b8c00000000]}}
>  {{+---------------+---------+}}
>  {{| created_date | count(*) |}}
>  {{+---------------+---------+}}
>  {{| 20180601 | 17881253 | -> CORRECT ONE}}
>  {{+---------------+---------+}}
>  {{Fetched 1 row(s) in 0.27s}}
>  {{[10.197.0.164:21000] > select created_date, count(*) from base.usage_kudu 
> where created_date >= 20180525 group by created_date order by 1;}}
>  {{Query: select created_date, count(*) from base.usage_kudu where 
> created_date >= 20180525 group by created_date order by 1}}
>  {{Query submitted at: 2018-06-04 21:12:02 (Coordinator: 
> [http://ip-10-197-0-164.eu-west-1.compute.internal:25000|http://ip-10-197-0-164.eu-west-1.compute.internal:25000/])}}
>  {{Query progress can be monitored at: 
> [http://ip-10-197-0-164.eu-west-1.compute.internal:25000/query_plan?query_id=4141df26117f35c3:9ab2f0700000000]}}
>  {{+---------------+---------+}}
>  {{| created_date | count(*) |}}
>  {{+---------------+---------+}}
>  {{| 20180525 | 22309857 |}}
>  {{| 20180526 | 15268520 |}}
>  {{| 20180527 | 14939691 |}}
>  {{| 20180528 | 17607943 |}}
>  {{| 20180529 | 20741097 |}}
>  {{| 20180530 | 17362364 |}}
>  {{| 20180531 | 16903829 |}}
>  {{| 20180601 | 18047010 | -> AGAIN WRONG RESULT!!}}
>  {{| 20180602 | 13325080 |}}
>  {{| 20180603 | 12145131 |}}
>  {{| 20180604 | 3788161 |}}
>  {{+---------------+---------+}}
>  {{Fetched 11 row(s) in 1.04s}}{{}}{{}}
> Again, no other inserts/selects/updates or deletes were running between these 
> statements on the cluster. 
>  
> I checked the explain, if there is a difference,but it looks ok. But the 
> result is different!
>  
> {{[10.197.0.164:21000] > explain select created_date, count(*) from 
> base.usage_kudu where created_date = 20180601 group by created_date;}}
>  {{Query: explain select created_date, count(*) from base.usage_kudu where 
> created_date = 20180601 group by created_date}}
>  {{+--------------------------------------------------+}}
>  {{| Explain String |}}
>  {{+--------------------------------------------------+}}
>  {{| Max Per-Host Resource Reservation: Memory=3.94MB |}}
>  {{| Per-Host Resource Estimates: Memory=20.00MB |}}
>  {{| |}}
>  {{| PLAN-ROOT SINK |}}
>  {{| | |}}
>  {{| 04:EXCHANGE [UNPARTITIONED] |}}
>  {{| | |}}
>  {{| 03:AGGREGATE [FINALIZE] |}}
>  {{| | output: count:merge(*) |}}
>  {{| | group by: created_date |}}
>  {{| | |}}
>  {{| 02:EXCHANGE [HASH(created_date)] |}}
>  {{| | |}}
>  {{| 01:AGGREGATE [STREAMING] |}}
>  {{| | output: count(*) |}}
>  {{| | group by: created_date |}}
>  {{| | |}}
>  {{| 00:SCAN KUDU [base.usage_kudu] |}}
>  {{| kudu predicates: created_date = 20180601 |}}
>  {{+--------------------------------------------------+}}
>  {{Fetched 19 row(s) in 0.06s}}
>  {{[10.197.0.164:21000] > select created_date, count(*) from base.usage_kudu 
> where created_date = 20180601 group by created_date;}}
>  {{Query: select created_date, count(*) from base.usage_kudu where 
> created_date = 20180601 group by created_date}}
>  {{Query submitted at: 2018-06-04 21:17:21 (Coordinator: 
> [http://ip-10-197-0-164.eu-west-1.compute.internal:25000|http://ip-10-197-0-164.eu-west-1.compute.internal:25000/])}}
>  {{Query progress can be monitored at: 
> [http://ip-10-197-0-164.eu-west-1.compute.internal:25000/query_plan?query_id=c449aabea51e7456:612f096400000000]}}
>  {{+---------------+---------+}}
>  {{| created_date | count(*) |}}
>  {{+---------------+---------+}}
>  {{| 20180601 | 17881253 |}}
>  {{+---------------+---------+}}
>  {{Fetched 1 row(s) in 0.38s}}
>  {{[10.197.0.164:21000] > explain select created_date, count(*) from 
> base.usage_kudu where created_date >= 20180525 group by created_date order by 
> 1;}}
>  {{Query: explain select created_date, count(*) from base.usage_kudu where 
> created_date >= 20180525 group by created_date order by 1}}
>  {{+--------------------------------------------------+}}
>  {{| Explain String |}}
>  {{+--------------------------------------------------+}}
>  {{| Max Per-Host Resource Reservation: Memory=9.94MB |}}
>  {{| Per-Host Resource Estimates: Memory=26.00MB |}}
>  {{| |}}
>  {{| PLAN-ROOT SINK |}}
>  {{| | |}}
>  {{| 05:MERGING-EXCHANGE [UNPARTITIONED] |}}
>  {{| | order by: created_date ASC |}}
>  {{| | |}}
>  {{| 02:SORT |}}
>  {{| | order by: created_date ASC |}}
>  {{| | |}}
>  {{| 04:AGGREGATE [FINALIZE] |}}
>  {{| | output: count:merge(*) |}}
>  {{| | group by: created_date |}}
>  {{| | |}}
>  {{| 03:EXCHANGE [HASH(created_date)] |}}
>  {{| | |}}
>  {{| 01:AGGREGATE [STREAMING] |}}
>  {{| | output: count(*) |}}
>  {{| | group by: created_date |}}
>  {{| | |}}
>  {{| 00:SCAN KUDU [base.usage_kudu] |}}
>  {{| kudu predicates: created_date >= 20180525 |}}
>  {{+--------------------------------------------------+}}
>  {{Fetched 23 row(s) in 0.05s}}
>  {{[10.197.0.164:21000] > select created_date, count(*) from base.usage_kudu 
> where created_date >= 20180525 group by created_date order by 1;}}
>  {{Query: select created_date, count(*) from base.usage_kudu where 
> created_date >= 20180525 group by created_date order by 1}}
>  {{Query submitted at: 2018-06-04 21:17:32 (Coordinator: 
> [http://ip-10-197-0-164.eu-west-1.compute.internal:25000|http://ip-10-197-0-164.eu-west-1.compute.internal:25000/])}}
>  {{Query progress can be monitored at: 
> [http://ip-10-197-0-164.eu-west-1.compute.internal:25000/query_plan?query_id=bc4a36f2a7ad3280:c7b09a5100000000]}}
>  {{+---------------+---------+}}
>  {{| created_date | count(*) |}}
>  {{+---------------+---------+}}
>  {{| 20180525 | 22309857 |}}
>  {{| 20180526 | 15268520 |}}
>  {{| 20180527 | 14939691 |}}
>  {{| 20180528 | 17607943 |}}
>  {{| 20180529 | 20741097 |}}
>  {{| 20180530 | 17362364 |}}
>  {{| 20180531 | 16903829 |}}
>  {{| 20180601 | 18047010 |}}
>  {{| 20180602 | 13325080 |}}
>  {{| 20180603 | 12145131 |}}
>  {{| 20180604 | 3788161 |}}
>  {{+---------------+---------+}}
>  {{Fetched 11 row(s) in 0.88s}}
>  
> {quote}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to