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

Remove fall back to legacy type mapping in Redshift #18209

Merged
merged 2 commits into from
Jul 11, 2023

Conversation

ssheikin
Copy link
Contributor

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.

# Section
* Fix some things. ({issue}`issuenumber`)

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);
Copy link
Member

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?

Copy link
Contributor Author

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.

Copy link
Member

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.

Copy link
Contributor Author

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.

Copy link
Member

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?

Copy link
Contributor Author

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.

@findepi
Copy link
Member

findepi commented Jul 10, 2023

LGTM. please make sure the tests pass before merging

@ssheikin ssheikin force-pushed the ssheikin/34/trino/redshift_super branch from 0b29b1b to fade80a Compare July 10, 2023 13:59
@@ -101,6 +103,40 @@ protected boolean hasBehavior(TestingConnectorBehavior connectorBehavior)
}
}

@Test
public void testSuperColumnType()
Copy link
Member

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).

Copy link
Member

@hashhar hashhar left a 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.

@ssheikin
Copy link
Contributor Author

@kokosing @hashhar @wendigo @findepi please merge

@hashhar hashhar merged commit 1da7f82 into trinodb:master Jul 11, 2023
@ssheikin ssheikin deleted the ssheikin/34/trino/redshift_super branch July 11, 2023 09:20
@github-actions github-actions bot added this to the 422 milestone Jul 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

4 participants