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
Conversation
Fixes: #2426 |
7da27a0
to
671779f
Compare
Fixes #2416 |
671779f
to
a7cda67
Compare
@kokosing Could you resolve conflicts? |
a7cda67
to
15e6a9f
Compare
@@ -36,7 +36,6 @@ public void testDefaults() | |||
.setConnectionUrl(null) | |||
.setCaseInsensitiveNameMatching(false) | |||
.setCaseInsensitiveNameMatchingCacheTtl(new Duration(1, MINUTES)) | |||
.setJdbcTypesMappedToVarchar(null) | |||
.setUnsupportedTypeHandling(UnsupportedTypeHandling.IGNORE) |
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.
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; |
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.
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"); |
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.
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"); |
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.
executeInPhoenix("DROP TABLE tpch.test_timestamp"); | |
assertUpdate("DROP TABLE test_timestamp"); |
15e6a9f
to
154f68e
Compare
Comments addressed. @ebyhr Thanks for the review! |
Unfortunately, it conflicted again. |
154f68e
to
d60600e
Compare
Rebased |
Sessions properties are registered per catalog (an instance of connector).
d60600e
to
c49faf8
Compare
Allow to convert to varchar an unsupported type in Phoenix