zhangayqian edited a comment on pull request #1088:
URL: https://github.com/apache/kylin/pull/1088#issuecomment-640479276
## Design test cases
### Prepare test env
- create cube and build segment `2012-01-01~2012-02-01`
- dimension: PART_DT, OPS_REGION
- measure: count_distinct(SELLER_ID)
### Test Case
- Query-1
```
select
intersect_count(SELLER_ID, OPS_REGION, array['Hongkong']) as h,
intersect_count(SELLER_ID, OPS_REGION, array['Beijing']) as b,
intersect_count(SELLER_ID, OPS_REGION, array['Shanghai']) as s,
intersect_count(SELLER_ID, OPS_REGION, array['Hongkong', 'Beijing']) as
retention_city1
from kylin_sales
```
- Query-2
```
select
intersect_count(SELLER_ID, OPS_REGION, array['Hongkong']) as h,
intersect_count(SELLER_ID, OPS_REGION, array['Beijing']) as b,
intersect_count(SELLER_ID, OPS_REGION, array['Shanghai']) as s,
intersect_count(SELLER_ID, OPS_REGION, array['Shanghai', 'Beijing']) as
retention_city2
from kylin_sales
```
- Query-3
```
select
intersect_count(SELLER_ID, OPS_REGION, array['Hongkong']) as h,
intersect_count(SELLER_ID, OPS_REGION, array['Beijing']) as b,
intersect_count(SELLER_ID, OPS_REGION, array['Shanghai']) as s,
intersect_count(SELLER_ID, OPS_REGION, array['Hongkong|Shanghai',
'Beijing']) as retention_city3
from kylin_sales
```
- Expect result
retention_city3 = retention_city1 + retention_city2
----------------------------------------------------------------
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:
[email protected]