-
Notifications
You must be signed in to change notification settings - Fork 5.3k
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
[native] Retrieve Json function metadata for prestissimo functions #22332
base: master
Are you sure you want to change the base?
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
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 for the feedback @aditi-pandit, addressed the review comments. Could you please take another look?
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.
@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? |
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.
@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
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 for the doc! Pulled branch and made a local docs build. Some nits of capitalization, everything else looks fine.
27d780d
to
90dd09f
Compare
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, 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? |
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 for the new doc! I have a suggestion about where the new page should be located, let me know what you think.
a691fcf
to
34effe2
Compare
Thanks for the suggestion @steveburnett, yes I agree |
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! (docs)
Pull updated branch, new local doc build, looks good. Thanks!
presto-native-execution/presto_cpp/presto_protocol/special/Language.cpp.inc
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
Show resolved
Hide resolved
cdb557e
to
396ecd2
Compare
…#10664) Summary: Prefix is not needed to register custom type `HyperLogLog` in `ApproxDistinctAggregates`. `registerHyperLogLogType` is used instead to make registration of customType `HyperLogLog` uniform across velox. Use of prefix in `registerCustomType` here resulted in the following error while running tests in [presto PR](prestodb/presto#22332): ``` Reason: Type doesn't exist: 'HYPERLOGLOG' Retriable: False Function: validateBaseTypeAndCollectTypeParams File: /Users/pramod/Desktop/velox/velox/expression/FunctionSignature.cpp Line: 125 ``` Pull Request resolved: #10664 Reviewed By: bikramSingh91 Differential Revision: D61163251 Pulled By: xiaoxmeng fbshipit-source-id: 8d316a9bc863a779ab81a50fb06b5d3761d8316b
a4723a0
to
c607530
Compare
@pramodsatya, I notice that the documentation I reviewed is not part of this PR now. Can I ask why? |
c607530
to
719cf99
Compare
Hi @steveburnett, @tdcmeehan shared that the OpenAPI documentation for this endpoint will be added in: #23358 , so I reverted the previous documentation. Would that be fine? |
Thanks @pramodsatya, I missed that! I thought there was probably a good reason for it that I had overlooked and didn't know what it was. Yes, that's fine with me, and I appreciate your explanation. |
@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/SystemTransactionHandle.java |
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.
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/tests/FunctionMetadataTest.cpp
Outdated
Show resolved
Hide resolved
88c8b7a
to
568e1cf
Compare
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
JsonBasedUdfFunctionMetadata
in 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 toJsonBasedUdfFunctionMetadata
and is serialized to JSON for consumption by the Java coordinator.Description
For full context, see #23000
This PR adds a http endpoint
/v1/functions
which returns the list of function signatures, conforming to formatJsonBasedUdfFunctionMetadata
, for all the presto functions supported in velox. Depends on Velox changes in the PR. This endpoint is registered inPrestoServer
only when it is configured as a sidecar.Test Plan
Unit tests are added in
FunctionMetadataTest.cpp
.cc: @tdcmeehan @soumiiow