matrixorigin / matrixone

Hyperconverged cloud-edge native database
https://docs.matrixorigin.cn/en
Apache License 2.0
1.79k stars 277 forks source link

[Feature Request]: Implement MySQL CRC32() function #20121

Open charleschile opened 1 week ago

charleschile commented 1 week ago

Is there an existing issue for the same feature request?

Is your feature request related to a problem?

CRC32() function is important in data migration and data comparison. It can be used to compare whether the data in two databases is the same: if the CRC32 sums are identical in both databases, the data in these columns is likely unchanged during data migration.

It can be used as below to check whether two columns from two databases are the same:

select (sum(crc32(concat_ws(',',`o_orderkey`,`o_custkey`,`o_orderstatus`,format( `o_totalprice`, 2),`o_orderdate`,`o_orderpriority`,`o_clerk`,`o_shippriority`,`o_comment`)) )) as `columns_md5__` from `tpch`.`orders` where 1=1        and ((`o_orderkey` >= 1)) and ((`o_orderkey` < 400001))

Describe the feature you'd like

Follow https://www.w3resource.com/mysql/mathematical-functions/mysql-crc32-function.php

Describe implementation you've considered

No response

Documentation, Adoption, Use Case, Migration Strategy

No response

Additional information

No response

Ariznawlll commented 2 days ago

能转换为字符串类型的与高老师商量,先不考虑crc32函数对其的支持

json类型的需要高老师帮忙给出结论,如果后续行为需要发生改变,再测试加bvt