Skip to content

Improve SQL Server type mapping documentation#11564

Merged
electrum merged 1 commit intotrinodb:masterfrom
tangjiangling:improve-sqlserver-type-mapping-docs
May 20, 2022
Merged

Improve SQL Server type mapping documentation#11564
electrum merged 1 commit intotrinodb:masterfrom
tangjiangling:improve-sqlserver-type-mapping-docs

Conversation

@tangjiangling
Copy link
Member

@tangjiangling tangjiangling commented Mar 18, 2022

Description

Is this change a fix, improvement, new feature, refactoring, or other?

Improvement.

Is this a change to the core query engine, a connector, client library, or the SPI interfaces? (be specific)

SQL Server type mapping doc.

How would you describe this change to a non-technical end user or system administrator?

N/A.

Related issues, pull requests, and links

Fixes #11280
Related #11448

Documentation

( ) No documentation is needed.
(x) Sufficient documentation is included in this PR.
( ) Documentation PR is available with #prnumber.
( ) Documentation issue #issuenumber is filed, and can be handled later.

Release notes

(x) No release notes entries required.
( ) Release notes entries required with the following suggested text:

@cla-bot cla-bot bot added the cla-signed label Mar 18, 2022
@tangjiangling tangjiangling marked this pull request as ready for review March 18, 2022 11:48
@tangjiangling tangjiangling requested review from ebyhr and hashhar March 18, 2022 11:48
@tangjiangling
Copy link
Member Author

tangjiangling commented Mar 18, 2022

Note: We mapped Trino CHAR/VARCHAR to SQL Server nchar/nvarchar in write operation, and the minimum length of SQL Server nchar/nvarchar is 1. But in the type mapping test we did not test what happens when we write CHAR(0)/VARCHAR(0) to SQL Server.

I'll send a pr to fix this.

@github-actions github-actions bot added the docs label Mar 18, 2022
@ebyhr ebyhr requested a review from mosabua March 18, 2022 12:51
@tangjiangling tangjiangling force-pushed the improve-sqlserver-type-mapping-docs branch from a23a2bf to f3bf16c Compare March 18, 2022 15:35
@tangjiangling tangjiangling added the no-release-notes This pull request does not require release notes entry label Mar 20, 2022
@mosabua mosabua requested a review from jhlodin March 21, 2022 17:27
Copy link
Contributor

@jhlodin jhlodin left a comment

Choose a reason for hiding this comment

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

Thanks for proposing these changes! Definitely an improvement. I commented some proposed changes that may be worth discussing, just want to find the best possible wording so we can start applying these changes to other connectors as well.

@tangjiangling
Copy link
Member Author

@jhlodin Thanks for the review, it was very useful ~
And I will update this pr later today.

@tangjiangling tangjiangling force-pushed the improve-sqlserver-type-mapping-docs branch 2 times, most recently from 92292a7 to a266f51 Compare March 22, 2022 15:11
@tangjiangling
Copy link
Member Author

Updated.
PTAL @jhlodin

@tangjiangling
Copy link
Member Author

@ebyhr @hashhar Please also take a look to see if the mapping is correct.

@jhlodin
Copy link
Contributor

jhlodin commented Mar 22, 2022

Thanks @tangjiangling ! Would definitely like to see review from maintainers to see if we all agree on the new wording.

Copy link
Member

@ebyhr ebyhr left a comment

Choose a reason for hiding this comment

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

Could you remove types where we don't have tests? e.g. XML, uniqueidentifier and so on

@tangjiangling tangjiangling force-pushed the improve-sqlserver-type-mapping-docs branch from a266f51 to 6daac78 Compare March 23, 2022 04:19
@tangjiangling
Copy link
Member Author

Could you remove types where we don't have tests? e.g. XML, uniqueidentifier and so on

Removed MONEY, SMALLMONEY, uniqueidentifier, XML, BINARY, IMAGE, TIMESTAMP, UDT, GEOMETRY, GEOGRAPHY.

If there is a strong demand from users one day, we can add it in.

@tangjiangling tangjiangling requested a review from ebyhr March 24, 2022 10:25
Copy link
Member

@mosabua mosabua left a comment

Choose a reason for hiding this comment

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

This is a great improvement. In the interest of making this a model for all other connectors I would like some input from @hashhar @electrum and others about better titles and descriptive text for the two mappings.

Here is my current (maybe faulty undestanding).

One mapping is for creating new columns in CTAS, ALTER TABLE, CREATE TABLE.

The other mapping is for working with existing columns. And that means for read (SELECT), but also write operations such as INSERT and UPDATE..

If this is correct .. what could be good titles for the two sections of mappings.

DB to Trino

and

Trino to DB

as we use them now are anything but intuitive ... we should come up with something better.. but what? Any suggestions?

@tangjiangling
Copy link
Member Author

Ping, could anyone help to review it? (so I can move forward with fixing #11448)

@jhlodin
Copy link
Contributor

jhlodin commented Apr 20, 2022

Ping, could anyone help to review it? (so I can move forward with fixing #11448)

+1, would be great to use this as a jumping-off point for improving the rest of our connectors' type mapping sections.
@hashhar @electrum @ebyhr

@mosabua mosabua requested a review from electrum April 20, 2022 19:50
@ebyhr ebyhr removed their request for review May 10, 2022 14:22
@electrum electrum merged commit 11731fc into trinodb:master May 20, 2022
@electrum
Copy link
Member

Thanks! This is a big improvement.

@github-actions github-actions bot added this to the 382 milestone May 20, 2022
@tangjiangling tangjiangling deleted the improve-sqlserver-type-mapping-docs branch May 21, 2022 06:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-signed docs no-release-notes This pull request does not require release notes entry

Development

Successfully merging this pull request may close these issues.

Add more mapping relationships to the SQL Server type mapping doc

5 participants