You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "Chuxin Chen (Jira)" <ji...@apache.org> on 2025/04/15 02:22:00 UTC

[jira] [Assigned] (CALCITE-6956) Support HyperLogLog for redis adapter

     [ https://issues.apache.org/jira/browse/CALCITE-6956?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Chuxin Chen reassigned CALCITE-6956:
------------------------------------

    Assignee: Chuxin Chen

> Support HyperLogLog for redis adapter
> -------------------------------------
>
>                 Key: CALCITE-6956
>                 URL: https://issues.apache.org/jira/browse/CALCITE-6956
>             Project: Calcite
>          Issue Type: Improvement
>            Reporter: Chuxin Chen
>            Assignee: Chuxin Chen
>            Priority: Major
>
> Hello, I want to support HyperLogLog for redis adapter.
> HyperLogLog is a data type in Redis designed for efficient cardinality estimation. After adding multiple elements to a key using `PFADD`, you can calculate the cardinality using `PFCOUNT`.  
> I plan to implement it as follows:  
> ```json
> {
>   "name": "uv_stats",
>   "factory": "org.apache.calcite.adapter.redis.RedisTableFactory",
>   "operand": {
>     "dataFormat": "hyperloglog",
>     "keyPattern": "uv:*",
>     "fields": [
>       {
>         "name": "key",
>         "type": "varchar"
>       },
>       {
>         "name": "CARDINAL_NUMBER",
>         "type": "long"
>       }
>     ]
>   }
> }
> ```
> This configuration will:  
> 1. Use wildcard matching (`uv:*`) to scan all HyperLogLog keys  
> 2. Calculate the cardinality of each key via `PFCOUNT`  
> 3. Display results in the format:  
> ```
> | -- key --|--CARDINAL_NUMBER--|
> | uv:20250411 | 4 |
> | uv:20250410 | 3 |
> ```



--
This message was sent by Atlassian Jira
(v8.20.10#820010)