risingwavelabs / risingwave

Best-in-class stream processing, analytics, and management. Perform continuous analytics, or build event-driven applications, real-time ETL pipelines, and feature stores in minutes. Unified streaming and batch. PostgreSQL compatible.
https://go.risingwave.com/slack
Apache License 2.0
6.82k stars 566 forks source link

feature: dynamic-precision decimal type #206

Closed fuyufjh closed 2 years ago

fuyufjh commented 2 years ago

In PostgresQL, there are 2 kinds of decimal (or numeric) types:

Currently, we only support fixed-point decimals, but considering that we are going to support schemaless in the future, it's better to support dynamic-precision decimals.

Order-preserved encoding of dynamic-precision decimals is difficult. I would recommend to investigate on cockroachdb first before implementation.

References:

  1. PostgreSQL: Documentation: 9.1: Numeric Types
  2. cockroach/decimal.go · cockroachdb/cockroach
  3. SQLite4: Key Encoding
lmatz commented 2 years ago

singularity-data/risingwave-legacy#2556 related

lmatz commented 2 years ago

Another reference is tidb It seems all of them are quite complicated. :sweat_smile: