-
Notifications
You must be signed in to change notification settings - Fork 80
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
Remove unnecessary CONCAT function #375
Conversation
Thank you for your pull request and welcome to the Trino community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. Continue to work with us on the review and improvements in this PR, and submit the signed CLA to [email protected]. Photos, scans, or digitally-signed PDF files are all suitable. Processing may take a few days. The CLA needs to be on file before we merge your changes. For more information, see https://github.com/trinodb/cla |
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 don't think this is valid syntax that will work in MySQL and PostgreSQL. Have you tested this in both?
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.
This isn't a valid syntax in case of MySQL.
Ahh, Yep. I see that. My apologies. In that case is CONCAT needed for this since its a singular input? If it is not a hard requirement dropping that should meet the need |
Also note that Spanner is not really something we use or test. Currently only MySQL and PostgreSQL are used. |
Looking at this I think you might be right and its not really needed. Maybe update the PR to get rid of it and we can see .. will also have to check other database scripts and see if there is something related going on. |
Thank you for your pull request and welcome to the Trino community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. Continue to work with us on the review and improvements in this PR, and submit the signed CLA to [email protected]. Photos, scans, or digitally-signed PDF files are all suitable. Processing may take a few days. The CLA needs to be on file before we merge your changes. For more information, see https://github.com/trinodb/cla |
@@ -62,7 +62,7 @@ SELECT count(1) FROM query_history | |||
Long count(@Define("condition") String condition); | |||
|
|||
@SqlQuery(""" | |||
SELECT CONCAT(FLOOR(created / 1000 / 60)) AS minute, | |||
SELECT FLOOR(created / 1000 / 60) AS minute, |
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.
Can you test with PostgreSQL and MySQL and share the screenshot of Web UI?
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.
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 testing, but the screenshot doesn't cover the actual situation. We should run a query before accessing the UI.
Note that current change causes NumberFormatException if the table isn't an empty. I would strongly recommend adding tests.
I started CI and it seems good. We will have to wait for you to submit a CLA and CLA processing. In the meantime .. @vishalya @willmostly @Chaho12 .. any concerns? |
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 👍
@@ -62,7 +62,7 @@ SELECT count(1) FROM query_history | |||
Long count(@Define("condition") String condition); | |||
|
|||
@SqlQuery(""" | |||
SELECT CONCAT(FLOOR(created / 1000 / 60)) AS minute, | |||
SELECT FLOOR(created / 1000 / 60) AS minute, |
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 testing, but the screenshot doesn't cover the actual situation. We should run a query before accessing the UI.
Note that current change causes NumberFormatException if the table isn't an empty. I would strongly recommend adding tests.
Thank you for your pull request and welcome to the Trino community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. Continue to work with us on the review and improvements in this PR, and submit the signed CLA to [email protected]. Photos, scans, or digitally-signed PDF files are all suitable. Processing may take a few days. The CLA needs to be on file before we merge your changes. For more information, see https://github.com/trinodb/cla |
I guess the
Change from The change is OK but the test doesn't cover the above issue. |
I'll update that shortly and the CLA email was sent last week |
CLA will be processed soon. |
@cla-bot check |
The cla-bot has been summoned, and re-checked this pull request! |
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.
Looks good to me now. Thanks for working with us on iterating to the right fix @grahamplata
Any concerns with merging this @ebyhr and @oneonestar ?
Waiting for the test to be updated. |
@grahamplata Any updates? |
Yep, sorry |
Thanks. |
Description
Resolves the following error when using Spanner by Explicitly Cast text values in CONCAT function.
SELECT CONCAT(FLOOR(created / 1000 / 60)::text) AS minute,
Resolved the following error
Additional context and related issues
Release notes
( ) This is not user-visible or is docs only, and no release notes are required.
( ) Release notes are required. Please propose a release note for me.
( ) Release notes are required, with the following suggested text:
*