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

add point type #273

Merged
merged 5 commits into from
Nov 23, 2023
Merged

add point type #273

merged 5 commits into from
Nov 23, 2023

Conversation

Dhruvit96
Copy link
Contributor

Summary

Add support for Point type.
Closes #151

Checklist

Delete items not relevant to your PR:

  • Unit and integration tests covering the common scenarios were added
  • A human-readable description of the changes was provided to include in CHANGELOG

@CLAassistant
Copy link

CLAassistant commented Nov 22, 2023

CLA assistant check
All committers have signed the CLA.

@genzgd
Copy link
Collaborator

genzgd commented Nov 22, 2023

Thanks for the PR!

I'm a little concerned about the implementation of converting Point to a Tuple(Float64, Float64). It looks like ClickHouse actually sends Point as the type:

CREATE TABLE points
(
    `key` UInt32,
    `value` Point
)
ENGINE = MergeTree
ORDER BY key

INSERT INTO points VALUES(1, (5.22, 7.83));

clickhouse client --port 9007 --query "SELECT * from points FORMAT Native" | xxd

00000000: 0201 036b 6579 0655 496e 7433 3201 0000  ...key.UInt32...
00000010: 0005 7661 6c75 6505 506f 696e 74e1 7a14  ..value.Point.z.
00000020: ae47 e114 4052 b81e 85eb 511f 40         [email protected].@

It seems we should be consistent and use the Point name when doing inserts as well, and for that approach I think it makes more sense to make a Point datatypes that extends clickhouse_connect.datatypes.containers.Tuple.

We probably should have at least one integration test as well.

@Dhruvit96
Copy link
Contributor Author

Dhruvit96 commented Nov 22, 2023

Thanks for the PR!

I'm a little concerned about the implementation of converting Point to a Tuple(Float64, Float64). It looks like ClickHouse actually sends Point as the type:

CREATE TABLE points
(
    `key` UInt32,
    `value` Point
)
ENGINE = MergeTree
ORDER BY key

INSERT INTO points VALUES(1, (5.22, 7.83));

clickhouse client --port 9007 --query "SELECT * from points FORMAT Native" | xxd

00000000: 0201 036b 6579 0655 496e 7433 3201 0000  ...key.UInt32...
00000010: 0005 7661 6c75 6505 506f 696e 74e1 7a14  ..value.Point.z.
00000020: ae47 e114 4052 b81e 85eb 511f 40         [email protected].@

It seems we should be consistent and use the Point name when doing inserts as well, and for that approach I think it makes more sense to make a Point datatypes that extends clickhouse_connect.datatypes.containers.Tuple.

We probably should have at least one integration test as well.

I have added Point type in container.py and also added one integration test.
Please let me know if any change is required.

@Dhruvit96
Copy link
Contributor Author

Hi can you please help me debug issue here.
I'm not sure why it's failing.

@genzgd
Copy link
Collaborator

genzgd commented Nov 23, 2023

The failure is not related to your PR, it's something in the test setup. I'll figure it out in the next day or so.

@Dhruvit96
Copy link
Contributor Author

Dhruvit96 commented Nov 23, 2023

The failure is not related to your PR, it's something in the test setup. I'll figure it out in the next day or so.

Meanwhile please let me know if any changes are required in code.

@genzgd genzgd merged commit ed14656 into ClickHouse:main Nov 23, 2023
26 of 28 checks passed
@genzgd
Copy link
Collaborator

genzgd commented Nov 23, 2023

This looks good! I think our cloud tests are failing due to something in Github Actions permissions, the merged version passes all tests. Your change should be included in a release shortly.

@Dhruvit96
Copy link
Contributor Author

Thank you for quick review!!

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.

Unrecognized ClickHouse type base: Point name: Point
3 participants