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

Allow to convert to varchar an unsupported type in Phoenix #2427

Merged
merged 9 commits into from Jan 8, 2020

Conversation

kokosing
Copy link
Member

@kokosing kokosing commented Jan 7, 2020

Allow to convert to varchar an unsupported type in Phoenix

@cla-bot cla-bot bot added the cla-signed label Jan 7, 2020
@kokosing kokosing requested a review from ebyhr January 7, 2020 09:32
@kokosing
Copy link
Member Author

kokosing commented Jan 7, 2020

Fixes: #2426

@kokosing
Copy link
Member Author

kokosing commented Jan 7, 2020

Fixes #2416

@ebyhr
Copy link
Member

ebyhr commented Jan 7, 2020

@kokosing Could you resolve conflicts?

@kokosing
Copy link
Member Author

kokosing commented Jan 7, 2020

@kokosing Could you resolve conflicts?

@ebyhr Done.

@@ -36,7 +36,6 @@ public void testDefaults()
.setConnectionUrl(null)
.setCaseInsensitiveNameMatching(false)
.setCaseInsensitiveNameMatchingCacheTtl(new Duration(1, MINUTES))
.setJdbcTypesMappedToVarchar(null)
.setUnsupportedTypeHandling(UnsupportedTypeHandling.IGNORE)
Copy link
Member

Choose a reason for hiding this comment

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

We should remove setUnsupportedTypeHandling instead of setJdbcTypesMappedToVarchar

@@ -16,7 +16,6 @@
import com.google.common.base.Splitter;
import com.google.common.collect.ImmutableSet;
import io.airlift.configuration.Config;
import io.airlift.configuration.ConfigDescription;
Copy link
Member

Choose a reason for hiding this comment

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

Revert (other properties have @ConfigDescription)

Also, we can remove unused unsupportedTypeHandling variable.

@@ -272,7 +272,10 @@ public BaseJdbcClient(
.setComment(comment)
.build());
}
verify(columnMapping.isPresent() || getUnsupportedTypeHandling(session) == IGNORE, "Unsupported type handling is set to %s, but toPrestoType() returned empty");
Copy link
Member

Choose a reason for hiding this comment

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

PostgreSqlClient also has the same logic.

withUnsupportedType(CONVERT_TO_VARCHAR),
"INSERT INTO test_timestamp VALUES (4, '2002-05-30 09:30:10.500')",
"Underlying type that is mapped to VARCHAR is not supported for INSERT: TIMESTAMP");
executeInPhoenix("DROP TABLE tpch.test_timestamp");
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
executeInPhoenix("DROP TABLE tpch.test_timestamp");
assertUpdate("DROP TABLE test_timestamp");

@kokosing
Copy link
Member Author

kokosing commented Jan 8, 2020

Comments addressed. @ebyhr Thanks for the review!

@ebyhr
Copy link
Member

ebyhr commented Jan 8, 2020

Unfortunately, it conflicted again.

@kokosing
Copy link
Member Author

kokosing commented Jan 8, 2020

Rebased

@kokosing kokosing merged commit 02f9903 into trinodb:master Jan 8, 2020
@kokosing kokosing deleted the origin/master/204_phoenix branch January 8, 2020 19:30
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.

None yet

2 participants