Skip to content

Add StringAt to ColumnDecimal#526

Merged
slabko merged 1 commit into
masterfrom
decimal-get-string
Jun 29, 2026
Merged

Add StringAt to ColumnDecimal#526
slabko merged 1 commit into
masterfrom
decimal-get-string

Conversation

@slabko

@slabko slabko commented Jun 27, 2026

Copy link
Copy Markdown
Contributor

Adds ColumnDecimal::StringAt(size_t), which returns the human-readable decimal string representation of the value at index i, with the decimal point inserted according to the column's scale.

Solves #477

@slabko slabko requested a review from mzitnik as a code owner June 27, 2026 08:20
Comment thread ut/columns_ut.cpp
};

std::vector<TestSample> samples = {
{18, 0, "0", "0"},

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

any invalid string case? e.g: {18, 0, "invalid"} and expect an exception?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This test checks that numeric values are correctly converted to strings. So input always should be good. There is a separate test that checks the parsing itself. This one for bad strings:
https://github.com/ClickHouse/clickhouse-cpp/blob/master/ut/columns_ut.cpp#L70

@slabko slabko merged commit 4c7f8c4 into master Jun 29, 2026
78 checks passed
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