[native] Retrieve Json function metadata for prestissimo functions#22332
[native] Retrieve Json function metadata for prestissimo functions#22332pramodsatya merged 2 commits intoprestodb:masterfrom
Conversation
3e2eac3 to
330b340
Compare
330b340 to
6386575
Compare
|
@pramodsatya : Please give more information about how this http method will be used in Presto server. |
presto-native-execution/presto_cpp/main/types/FunctionMetadata.h
Outdated
Show resolved
Hide resolved
presto-native-execution/presto_cpp/main/types/tests/FunctionMetadataTest.cpp
Outdated
Show resolved
Hide resolved
presto-native-execution/presto_cpp/main/types/tests/FunctionMetadataTest.cpp
Outdated
Show resolved
Hide resolved
presto-native-execution/presto_cpp/main/types/tests/FunctionMetadataTest.cpp
Outdated
Show resolved
Hide resolved
presto-native-execution/presto_cpp/main/types/FunctionMetadata.cpp
Outdated
Show resolved
Hide resolved
presto-native-execution/presto_cpp/main/types/FunctionMetadata.cpp
Outdated
Show resolved
Hide resolved
presto-native-execution/presto_cpp/main/types/FunctionMetadata.cpp
Outdated
Show resolved
Hide resolved
presto-native-execution/presto_cpp/main/types/FunctionMetadata.cpp
Outdated
Show resolved
Hide resolved
presto-native-execution/presto_cpp/main/types/FunctionMetadata.cpp
Outdated
Show resolved
Hide resolved
presto-native-execution/presto_cpp/main/types/FunctionMetadata.cpp
Outdated
Show resolved
Hide resolved
bd8b27f to
edd9e93
Compare
edd9e93 to
0cf2dd5
Compare
pramodsatya
left a comment
There was a problem hiding this comment.
Thanks for the feedback @aditi-pandit, addressed the review comments. Could you please take another look?
mbasmanova
left a comment
There was a problem hiding this comment.
@pramodsatya Would you document the new endpoint somewhere in https://prestodb.io/docs/current/develop/worker-protocol.html ?
0cf2dd5 to
27d780d
Compare
|
@mbasmanova we have started to document our endpoints using OpenAPI, and eventually all sidecar endpoints (and, hopefully all Presto endpoints) will have corresponding OpenAPI documentation. |
Sounds cool. Where can I see docs for the new endpoint? |
aditi-pandit
left a comment
There was a problem hiding this comment.
@pramodsatya : The changes look good. Please add more test cases though... We should cover functions with different types, template parameters, array, map functions as well.
presto-native-execution/presto_cpp/main/types/FunctionMetadata.cpp
Outdated
Show resolved
Hide resolved
presto-native-execution/presto_cpp/main/types/FunctionMetadata.cpp
Outdated
Show resolved
Hide resolved
presto-native-execution/presto_cpp/main/types/FunctionMetadata.cpp
Outdated
Show resolved
Hide resolved
presto-native-execution/presto_cpp/main/types/FunctionMetadata.cpp
Outdated
Show resolved
Hide resolved
presto-native-execution/presto_cpp/main/types/tests/FunctionMetadataTest.cpp
Outdated
Show resolved
Hide resolved
presto-native-execution/presto_cpp/main/types/tests/FunctionMetadataTest.cpp
Outdated
Show resolved
Hide resolved
presto-native-execution/presto_cpp/main/types/tests/FunctionMetadataTest.cpp
Outdated
Show resolved
Hide resolved
steveburnett
left a comment
There was a problem hiding this comment.
Thanks for the doc! Pulled branch and made a local docs build. Some nits of capitalization, everything else looks fine.
27d780d to
90dd09f
Compare
czentgr
left a comment
There was a problem hiding this comment.
Thanks, I have a few comments.
presto-native-execution/presto_cpp/main/types/tests/CMakeLists.txt
Outdated
Show resolved
Hide resolved
presto-native-execution/presto_cpp/main/types/tests/CMakeLists.txt
Outdated
Show resolved
Hide resolved
presto-native-execution/presto_cpp/presto_protocol/presto_protocol.yml
Outdated
Show resolved
Hide resolved
presto-native-execution/presto_cpp/presto_protocol/special/Language.cpp.inc
Outdated
Show resolved
Hide resolved
90dd09f to
a006c3e
Compare
Thanks for the feedback @czentgr, I have addressed the comments. Could you please take another look? |
|
@pramodsatya : Please can you rebase your code. I'll continue with the review then. |
4ed8961 to
56813d3
Compare
Thanks @aditi-pandit, rebased and fixed the CI failures. |
56813d3 to
da222f9
Compare
da222f9 to
88c8b7a
Compare
| - presto-main/src/main/java/com/facebook/presto/connector/system/SystemColumnHandle.java | ||
| - presto-main/src/main/java/com/facebook/presto/connector/system/SystemTableLayoutHandle.java | ||
| - presto-main/src/main/java/com/facebook/presto/connector/system/SystemTransactionHandle.java No newline at end of file | ||
| - presto-main/src/main/java/com/facebook/presto/connector/system/SystemTransactionHandle.java |
There was a problem hiding this comment.
Agree that there isn't particular organization in this file. But we should make it in alphabetical order. Will send out a PR for it.
presto-native-execution/presto_cpp/main/types/FunctionMetadata.cpp
Outdated
Show resolved
Hide resolved
presto-native-execution/presto_cpp/main/types/FunctionMetadata.cpp
Outdated
Show resolved
Hide resolved
presto-native-execution/presto_cpp/main/types/FunctionMetadata.cpp
Outdated
Show resolved
Hide resolved
presto-native-execution/presto_cpp/main/types/FunctionMetadata.cpp
Outdated
Show resolved
Hide resolved
presto-native-execution/presto_cpp/main/types/FunctionMetadata.cpp
Outdated
Show resolved
Hide resolved
presto-native-execution/presto_cpp/main/types/tests/FunctionMetadataTest.cpp
Outdated
Show resolved
Hide resolved
88c8b7a to
568e1cf
Compare
|
@pramodsatya : This code looks good. @czentgr : Would be great if you did a pass as well. Will give approval once you give a heads-up. |
czentgr
left a comment
There was a problem hiding this comment.
One thought and one nit.
presto-native-execution/presto_cpp/main/types/FunctionMetadata.cpp
Outdated
Show resolved
Hide resolved
568e1cf to
d716ca2
Compare
pramodsatya
left a comment
There was a problem hiding this comment.
Thanks for the feedback @czentgr @aditi-pandit. Consolidated the sidecar endpoints to a single function, also added a helper function to identify and exclude function signatures with unsupported Presto types (hugeint is currently unsupported in Presto). Could you please take another look?
d716ca2 to
37deb95
Compare
aditi-pandit
left a comment
There was a problem hiding this comment.
@pramodsatya : Have 2 minor comments. Rest is looking good.
presto-native-execution/presto_cpp/main/types/tests/TestUtils.cpp
Outdated
Show resolved
Hide resolved
37deb95 to
11c83e3
Compare
pramodsatya
left a comment
There was a problem hiding this comment.
Thanks for the feedback @aditi-pandit, addressed the comments. Could you please take another look?
presto-native-execution/presto_cpp/main/types/tests/TestUtils.cpp
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Thanks @pramodsatya
Please can you also add a link to the documentation of the API.
|
@aditi-pandit |
Motivation and Context
For fail fast function validation in Prestissimo, the coordinator needs to know the list of function signatures that are supported by Prestissimo. This is so we can validate during parsing and analysis that a function is supported. In order to expose this, a new HTTP method is added that returns the function signatures supported by the Prestissimo worker.
The format of the functions should be a map of name to function signature. Name is a simple string. Function signature is a JSON object which matches the format of
JsonBasedUdfFunctionMetadatain the Java code. All functions currently come from Velox, hence we need to retrieve the list of supported functions in Velox. This map is translated to a format that conforms toJsonBasedUdfFunctionMetadataand is serialized to JSON for consumption by the Java coordinator.Description
For full context, see #23000
This PR adds a http endpoint
/v1/functionsto the sidecar, which returns the list of function signatures conforming to formatJsonBasedUdfFunctionMetadatafor all the registered Presto native functions.Test Plan
Unit tests are added in
FunctionMetadataTest.cpp. E2E tests will be added in a followup PR