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

[ClickHouse Compatibility] +/-Infinity values parsing #1185

Closed
MaceWindu opened this issue Jun 27, 2022 · 4 comments
Closed

[ClickHouse Compatibility] +/-Infinity values parsing #1185

MaceWindu opened this issue Jun 27, 2022 · 4 comments

Comments

@MaceWindu
Copy link
Contributor

ClickHouse supports NaN, Infinity and -Infinity values for float/double types, which cannot be parsed by MySqlConnector here:

  • NaN value sent as"nan" and parsed successfully
  • Infinity and -Infinity sent as "inf" and "-inf" and result in FormatException

Describe the solution you'd like

Would be nice to support those two values (always or using some ClickHouse compatibility switch/connection string parameter).

I cannot find any information on float/double encoding in spec, probably looking at wrong place as I'm not familiar with it at all (https://dev.mysql.com/doc/internals/en/string.html)

@bgrainger
Copy link
Member

double.Parse("∞") returns double.PositiveInfinity; doesn't seem unreasonable to add hard-coded support for inf and -inf.

@bgrainger
Copy link
Member

I didn't actually test with ClickHouse, but added support for -inf and inf as described in the case.

@bgrainger
Copy link
Member

Implemented in 2.1.11.

@MaceWindu
Copy link
Contributor Author

Thanks, it works!

okramarenko added a commit to memsql/SingleStoreNETConnector that referenced this issue Apr 3, 2023
Summary:
This diff grabs changes from original connector that were made in 2.1.10-2.1.11 releases:
- Add ConflictOption property to SingleStoreBulkCopy. Fixes mysql-net#1148
- Fix NullReferenceException in SingleStoreConnector.Utilities.TimerQueue.Callback
- Perform UTF-8 conversion at compile time
- Support floating point infinity. Fixes mysql-net#1185
- Delete obsolete SingleStoreConnector.Performance project
- Generate SchemaProvider code (Switch SchemaProvider to be code-generated from a YAML definition. This will make it easier to add generated documentation and restrictions)

Test Plan: https://app.circleci.com/pipelines/github/memsql/SingleStoreNETConnector/258/workflows/57f23614-207f-4960-921f-9fbed813ab2a

Reviewers: pmishchenko-ua

Subscribers: engineering-list

JIRA Issues: PLAT-6408

Differential Revision: https://grizzly.internal.memcompute.com/D61846
okramarenko added a commit to memsql/SingleStoreNETConnector that referenced this issue Apr 4, 2023
Summary:
This diff grabs changes from original connector that were made in 2.1.10-2.1.11 releases:
- Add ConflictOption property to SingleStoreBulkCopy. Fixes mysql-net#1148
- Fix NullReferenceException in SingleStoreConnector.Utilities.TimerQueue.Callback
- Perform UTF-8 conversion at compile time
- Support floating point infinity. Fixes mysql-net#1185
- Delete obsolete SingleStoreConnector.Performance project
- Generate SchemaProvider code (Switch SchemaProvider to be code-generated from a YAML definition. This will make it easier to add generated documentation and restrictions)

Test Plan: https://app.circleci.com/pipelines/github/memsql/SingleStoreNETConnector/258/workflows/57f23614-207f-4960-921f-9fbed813ab2a

Reviewers: pmishchenko-ua

Reviewed By: pmishchenko-ua

Subscribers: engineering-list

JIRA Issues: PLAT-6408

Differential Revision: https://grizzly.internal.memcompute.com/D61846
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

2 participants