-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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 fall back to legacy type mapping in Redshift #18209
Remove fall back to legacy type mapping in Redshift #18209
Conversation
We should not fall back to legacy behavior, the mappings should be explicit (the legacyToWriteMapping is just a copy of some generic default mappings that used to exist)
@@ -598,8 +598,10 @@ public Optional<ColumnMapping> toColumnMapping(ConnectorSession session, Connect | |||
longTimestampWithTimeZoneWriteFunction())); | |||
} | |||
|
|||
// Fall back to default behavior | |||
return legacyToColumnMapping(session, type); |
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 we also remove redshift.use-legacy-type-mapping
?
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 not sure. I don't know why it was introduced and I don't know what deprecation process does trino have.
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.
same argument could be given for removal of this line.
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.
Not exactly. Right now if someone would like to use legacy, they can switch redshift.use-legacy-type-mapping
and get it back. This fallback was enhancing proper type mapping
with some legacy wrong behaviour.
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.
Agreed, this is not exactly same.
When do we plan to remove redshift.use-legacy-type-mapping
?
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.
@findepi I'd be glad to remove that code and to answer your questions, but unfortunately I don't know.
I see that this property was added in the commit
Add config property to disable new Redshift type mappings
6fc0b247 Dain Sundstrom <dain@iq80.com> on 23/12/2022 at 00:57
According to https://trino.io/development/process.html#contribution-process
unless the change is trivial, for example a spelling fix in the documentation
it worth to
Start a discussion by creating a GitHub issue, or asking on Slack
Also I'd prefer to merge this PR as soon as possible.
plugin/trino-redshift/src/test/java/io/trino/plugin/redshift/TestRedshiftConnectorTest.java
Show resolved
Hide resolved
LGTM. please make sure the tests pass before merging |
0b29b1b
to
fade80a
Compare
@@ -101,6 +103,40 @@ protected boolean hasBehavior(TestingConnectorBehavior connectorBehavior) | |||
} | |||
} | |||
|
|||
@Test | |||
public void testSuperColumnType() |
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.
reminder that CI doesn't run this test class at all (not even with /test-with-secrets).
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've verified the Redshift tests pass with these changes externally.
We should not fall back to legacy behavior,
the mappings should be explicit (the legacyToWriteMapping is just a
copy of some generic default mappings that used to exist)
Description
Additional context and related issues
Release notes
( ) This is not user-visible or docs only and no release notes are required.
( ) Release notes are required, please propose a release note for me.
(x) Release notes are required, with the following suggested text:
Remove fall back to legacy type mapping in Redshift.