-
Notifications
You must be signed in to change notification settings - Fork 5.5k
Add a native type manager #24179
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
Add a native type manager #24179
Conversation
85c6d41 to
bfb9ee4
Compare
...-sidecar-plugin/src/main/java/com/facebook/presto/sidecar/typemanager/NativeTypeManager.java
Show resolved
Hide resolved
presto-spi/src/main/java/com/facebook/presto/spi/type/TypesProvider.java
Outdated
Show resolved
Hide resolved
presto-main/src/main/java/com/facebook/presto/metadata/FunctionAndTypeManager.java
Outdated
Show resolved
Hide resolved
9ae0d1c to
fa3a49b
Compare
auden-woolfson
left a comment
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
fa3a49b to
cb8ea2d
Compare
cb8ea2d to
b93cb01
Compare
|
@ZacBlanco Do you wanna take a look? |
| public Type getType(TypeSignature typeSignature) | ||
| { | ||
| // Todo: Fix this hack, native execution does not support parameterized char/varchar type signatures. | ||
| if (typeSignature.getBase().equals(CHAR) || typeSignature.getBase().equals(VARCHAR)) { |
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.
Trying to reduce the impact of this hack. What happens if we remove CHAR from this condition and fail all the queries with it ?
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.
Done, removed CHAR.
presto-main/src/main/java/com/facebook/presto/metadata/FunctionAndTypeManager.java
Outdated
Show resolved
Hide resolved
1e40d04 to
b816611
Compare
|
@rschlussel |
|
@rschlussel can you help to review this PR?Thanks. |
i don't think i understand what this means. Why doesn't native engine allow creating tables with char column? Currently without sidecar, what happens if someone runs a query on a table with a char column? |
As of now, the native engine allows creating tables with char column and queries on a table with a char column should succeed. But with sidecar enabled, we are getting a list of supported types by the native engine and |
if currently we can run queries on char columns, then why is it not supported? |
I am not really sure what happens under the hood right now when you create a table with char columns in a native cluster. The native engine does not understand char type, maybe it gets casted to a varchar( not sure) ? cc: @aditi-pandit. |
|
@gggrace14 showed me that we actually are failing now in the workers when you try to query a char column, so this change should be okay. |
aditi-pandit
left a comment
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 @pdabre12
@rschlussel : Today C++ clusters would support CREATE TABLE with char columns (as that is purely at the co-ordinator), but SELECT from them would fail at the workers since the PrestoToVelox conversions would reject the CHAR column. With this change, CHAR would not be exposed as a type, so even CREATE TABLE with char columns would fail. |
Description
With the introduction of the presto-native-execution module, Presto now has forked the execution engine into a separate process. This allows for the execution engine to be written in C++ and to be more efficient than the Java execution engine. However, this also means that the execution engine code is now entirely separate from the coordinator code, and that the types supported by the coordinator might not necessarily be supported by the execution engine.
This change adds a new native type manager which allows the types supported by the C++ engine to be known to the Java coordinator.
For more context: RFC-0003
Test Plan
Unit and end-to-end tests. More comprehensive end-to-end tests will be written in the future.
Contributor checklist
Release Notes
Please follow release notes guidelines and fill in the release notes below.