You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by GitBox <gi...@apache.org> on 2019/11/18 03:06:14 UTC
[GitHub] [incubator-doris] WingsGo opened a new issue #2221: Partitition
Column with type INT compare with String Literals will cause full table scan
WingsGo opened a new issue #2221: Partitition Column with type INT compare with String Literals will cause full table scan
URL: https://github.com/apache/incubator-doris/issues/2221
**Describe the bug**
when use INT type as partition column, and use string literals compare with the INT type partition column will cause a full table scan. for example: select count(*) from bb_29_browser_category_expose where bigbi_partition_date = '20191117';
**To Reproduce**
Steps to reproduce the behavior:
1. show partitions from bb_29_browser_category_expose, and partitions as follows:
+-------------+---------------+----------------+---------------------+--------+----------------------+-----------------------------------------------------------------------+-------------------+---------+----------------+---------------+---------------------+--------------------------+----------+
| PartitionId | PartitionName | VisibleVersion | VisibleVersionHash | State | PartitionKey | Range | DistributionKey | Buckets | ReplicationNum | StorageMedium | CooldownTime | LastConsistencyCheckTime | DataSize |
+-------------+---------------+----------------+---------------------+--------+----------------------+-----------------------------------------------------------------------+-------------------+---------+----------------+---------------+---------------------+--------------------------+----------+
| 70436 | p20191116 | 2 | 46465871928709068 | NORMAL | bigbi_partition_date | [types: [INT]; keys: [20191116]; ‥types: [INT]; keys: [20191117]; ) | bigbi_buckets_num | 10 | 1 | HDD | 9999-12-31 23:59:59 | N/A | 1.670 KB |
| 70457 | p20191117 | 2 | 8074237191208596126 | NORMAL | bigbi_partition_date | [types: [INT]; keys: [20191117]; ‥types: [INT]; keys: [20191118]; ) | bigbi_buckets_num | 10 | 1 | HDD | 9999-12-31 23:59:59 | N/A | 1.670 KB |
| 70478 | p20191118 | 2 | 7727884776994719576 | NORMAL | bigbi_partition_date | [types: [INT]; keys: [20191118]; ‥types: [INT]; keys: [20191119]; ) | bigbi_buckets_num | 10 | 1 | HDD | 9999-12-31 23:59:59 | N/A | 1.670 KB |
| 70499 | p20191119 | 2 | 7919264615151879607 | NORMAL | bigbi_partition_date | [types: [INT]; keys: [20191119]; ‥types: [INT]; keys: [20191120]; ) | bigbi_buckets_num | 10 | 1 | HDD | 9999-12-31 23:59:59 | N/A | 1.670 KB |
+-------------+---------------+----------------+---------------------+--------+----------------------+-----------------------------------------------------------------------+-------------------+---------+----------------+---------------+---------------------+--------------------------+----------+
4 rows in set (0.00 sec)
2. explain select count(*) from bb_29_browser_category_expose where bigbi_partition_date = '20191117';
| 0:OlapScanNode |
| TABLE: bb_29_browser_category_expose |
| PREAGGREGATION: ON |
| PREDICATES: `bigbi_partition_date` = 2.0191117E7 |
| partitions=4/4 |
| rollup: bb_29_browser_category_expose |
| buckets=40/40 |
| cardinality=3 |
| avgRowSize=2280.0 |
| numNodes=1 |
| tuple ids: 0 |
+-------------------------------------------------------+
**Expected behavior**
as shown above, scan partitions is 4/4, and we expected that the sql can only scan one partition.
**Screenshots**
If applicable, add screenshots to help explain your problem.


----------------------------------------------------------------
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:
users@infra.apache.org
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org