Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add OpenAPI documentation for /v1/functions
Browse files Browse the repository at this point in the history
pdabre12 authored and Pratik Joseph Dabre committed Sep 13, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
1 parent af997ba commit c3ed29f
Showing 2 changed files with 75 additions and 0 deletions.
20 changes: 20 additions & 0 deletions presto-openapi/src/main/resources/function_signatures.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
openapi: 3.0.0
info:
title: Presto function signatures API
description: API for retrieving function signatures in Presto.
version: "1"
servers:
- url: http://localhost:8080
description: Presto endpoint when running locally
paths:
/v1/functions:
get:
summary: Returns the list of function signatures.
description: This endpoint retrieves the supported function signatures from a Prestissimo cluster.
responses:
'200':
description: List of function signatures.
content:
application/json:
schema:
$ref: './schemas.yaml/#/components/schemas/JsonBasedUdfFunctionMetadata'
55 changes: 55 additions & 0 deletions presto-openapi/src/main/resources/schemas.yaml
Original file line number Diff line number Diff line change
@@ -999,6 +999,61 @@ components:
QueryInfo:
type: object
# TODO generate all the classes for this object
AggregationFunctionMetadata:
type: object
required:
- intermediateType
- isOrderSensitive
properties:
intermediateType:
$ref: '#/components/schemas/TypeSignature'
description: Intermediate TypeSignature for the aggregation function
isOrderSensitive:
type: boolean
description: Determines if the corresponding aggregation function is order-sensitive
JsonBasedUdfFunctionMetadata:
type: object
required:
- docString
- functionKind
- outputType
- paramTypes
- schema
- routineCharacteristics
- variableArity
properties:
docString:
type: string
description: Description of the function
functionKind:
$ref: '#/components/schemas/FunctionKind'
description: FunctionKind of the function
outputType:
$ref: '#/components/schemas/TypeSignature'
description: Output type of the function
paramTypes:
type: array
items:
$ref: '#/components/schemas/TypeSignature'
description: Input types of the function
schema:
type: string
description: Schema the function belongs to. Catalog.schema.function uniquely identifies a function.
routineCharacteristics:
$ref: '#/components/schemas/RoutineCharacteristics'
description: Implement language of the function.
variableArity:
type: boolean
description: Arity of the function.
typeVariableConstraints:
type: array
items:
$ref: '#/components/schemas/TypeVariableConstraint'
description: Optional list of the typeVariableConstraints.
aggregationFunctionMetadata:
$ref: '#/components/schemas/AggregationFunctionMetadata'
description: Optional Aggregate-specific metadata (required for aggregation functions)




0 comments on commit c3ed29f

Please sign in to comment.