-
Notifications
You must be signed in to change notification settings - Fork 5.5k
fix(plugin-singlestore): Varchar type mapping #25476
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
fix(plugin-singlestore): Varchar type mapping #25476
Conversation
|
Consider adding documentation to https://github.com/prestodb/presto/blob/master/presto-docs/src/main/sphinx/connector/singlestore.rst similar to the Type Mapping topic in the Iceberg Connector doc. |
...lestore/src/test/java/com/facebook/presto/plugin/singlestore/TestSingleStoreTypeMapping.java
Outdated
Show resolved
Hide resolved
presto-singlestore/src/main/java/com/facebook/presto/plugin/singlestore/SingleStoreClient.java
Show resolved
Hide resolved
135b6bc to
c5368ae
Compare
steveburnett
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the doc! A formatting nit, and a question.
c5368ae to
5f6913e
Compare
steveburnett
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! (docs)
Pull updated branch, new local doc build. Thanks!
BryanCutler
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, just a question about the commented test case
...lestore/src/test/java/com/facebook/presto/plugin/singlestore/TestSingleStoreTypeMapping.java
Outdated
Show resolved
Hide resolved
presto-singlestore/src/main/java/com/facebook/presto/plugin/singlestore/SingleStoreClient.java
Outdated
Show resolved
Hide resolved
presto-singlestore/src/main/java/com/facebook/presto/plugin/singlestore/SingleStoreClient.java
Show resolved
Hide resolved
5f6913e to
9760f89
Compare
steveburnett
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! (docs)
Pull updated branch, new local doc build, looks good.
Thanks for the doc!
pratyakshsharma
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Couple of minor comments, thank you for the PR.
| * - ``CHAR(len)`` | ||
| - ``CHAR(len)`` | ||
| * - ``MEDIUMTEXT`` | ||
| - ``VARCHAR(len) 21845 < len < 5592405`` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What if the length is exactly 21845? Similarly for 5592045?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @pratyakshsharma, this needs to be fixed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm still a little confused about the numbers above? Shouldn't it be VARCHAR(len) 21845 <= len < 5592405?
| .row("orderkey", "bigint", "", "") | ||
| .row("custkey", "bigint", "", "") | ||
| .row("orderstatus", "varchar(85)", "", "")//utf8 | ||
| .row("orderstatus", "varchar(1)", "", "")//utf8 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why are we changing these lengths?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These are the actual lengths of those columns, previously it was taking a default length for all varchars lower than 85 represented by tiny text.
|
Can we add a test case to cover the scenario of max length supported for varchar/longtext, if possible? |
Does presto support that much length for a varchar as of today? |
b36e9af to
a0c8d0d
Compare
steveburnett
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the doc! One suggestion of restructuring the doc for you to consider. Let me know what you think!
steveburnett
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the doc! Just a nit of formatting.
|
Thanks for the release note entry! Minor suggestions: |
669c84d to
b5c79e2
Compare
|
@steveburnett and @pratyakshsharma can you give me a final approval |
steveburnett
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! (docs)
Pull updated branch, new local doc build. Thanks!
BryanCutler
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
steveburnett
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! (docs)
Pull updated branch, new local doc build.
pratyakshsharma
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the fix and clarifying all my doubts.
|
Please check the failures and squash the commits, thanks. |
Currently varchar(len) is mapped to either tinytext, text, mediumtext or longtext of singlestore types. However now singlestore supports varchar with length upto varchar(21844). So we need not convert it into tiny text or text.
e76223f to
bc3c1e6
Compare
Description
Currently varchar(len) is mapped to either tinytext, text, mediumtext or longtext of singlestore types. However now singlestore supports varchar with length upto varchar(21844). So, we do not convert varchar length < 21844 into tiny text or text.
More details: https://docs.singlestore.com/cloud/reference/sql-reference/data-types/string-types/
Motivation and Context
We can preserve original table's varchar length as long as they are within the limit of 21844.
Impact
Improved compatibility with singlestore with more accurate type mapping.
Test Plan
Added and fixed existing tests.
Contributor checklist
Release Notes
Please follow release notes guidelines and fill in the release notes below.