Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hyperloglog 增加部分注释 #111

Open
wants to merge 4 commits into
base: 7.0-cn-annotated
Choose a base branch
from

Conversation

ziruiLiu-g
Copy link
Contributor

写完发现另一位朋友2月8号已经提交了大部分 hyperloglog 的内容
这里加上我写的部分内容

Copy link
Collaborator

@enjoy-binbin enjoy-binbin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

对位运算不是很熟悉,也还没有想着去搞懂 HLL 里的具体算法,所以中间部分计算 6 bits 部分没有细看

@huihuang-chen 也请帮忙看一眼

Comment on lines 430 to 432
* * +--------+--------+--------+------//
* |11000000|22221111|33333322|55444444
* +--------+--------+--------+------//
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* * +--------+--------+--------+------//
* |11000000|22221111|33333322|55444444
* +--------+--------+--------+------//
* +--------+--------+--------+------//
* |11000000|22221111|33333322|55444444
* +--------+--------+--------+------//

* +--------+ +--------+
* 下标为 0 的字节数组 下标为 1 的字节数组
*
* 因此给寄存器重新设置值可以分为两部:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* 因此给寄存器重新设置值可以分为两部
* 因此给寄存器重新设置值可以分为两步

@enjoy-binbin enjoy-binbin changed the title Hyperloglog Hyperloglog 增加部分注释 Feb 22, 2023
@ziruiLiu-g
Copy link
Contributor Author

这个pr有朋友来 review下嘛

Comment on lines +839 to +841
* ZERO 操作码:占用 1 个字节,表示为 00xxxxxx,后六位表示有 2^6 + 1 个寄存器可以被设置为 0
* XZERO 操作码:占用 2 个字节,表示为 01xxxxxx yyyyyyyy,表示有 2^14 + 1 个寄存器可以被设置为 0
* VAL 操作码:占用 1 个字节,表示为 1vvvvvxx。vvvvv 表示值,范围为 1-2^5。后两位 xx 表示数量 2^2,整体表示为最多有 2^2 个寄存器被设置为值 vvvvv */
Copy link
Collaborator

@enjoy-binbin enjoy-binbin Mar 26, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这边应该是减 1 吧

Suggested change
* ZERO 操作码占用 1 个字节表示为 00xxxxxx后六位表示有 2^6 + 1 个寄存器可以被设置为 0
* XZERO 操作码占用 2 个字节表示为 01xxxxxx yyyyyyyy表示有 2^14 + 1 个寄存器可以被设置为 0
* VAL 操作码占用 1 个字节表示为 1vvvvvxxvvvvv 表示值范围为 1-2^5后两位 xx 表示数量 2^2整体表示为最多有 2^2 个寄存器被设置为值 vvvvv */
* ZERO 操作码占用 1 个字节表示为 00xxxxxx后六位表示有 2^6 -1 个寄存器可以被设置为 0
* XZERO 操作码占用 2 个字节表示为 01xxxxxx yyyyyyyy表示有 2^14 -1 个寄存器可以被设置为 0
* VAL 操作码占用 1 个字节表示为 1vvvvvxxvvvvv 表示值范围为 1 (2^5 -1)后两位 xx 表示数量 2^2整体表示为最多有 2^2 -1 个寄存器被设置为值 vvvvv */

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants