Search in sources :

Example 1 with DescribeFunction

use of io.confluent.ksql.parser.tree.DescribeFunction in project ksql by confluentinc.

the class DescribeFunctionExecutor method execute.

public static StatementExecutorResponse execute(final ConfiguredStatement<DescribeFunction> statement, final SessionProperties sessionProperties, final KsqlExecutionContext executionContext, final ServiceContext serviceContext) {
    final DescribeFunction describeFunction = statement.getStatement();
    final FunctionName functionName = FunctionName.of(describeFunction.getFunctionName());
    if (executionContext.getMetaStore().isAggregate(functionName)) {
        return StatementExecutorResponse.handled(Optional.of(describeAggregateFunction(executionContext, functionName, statement.getStatementText())));
    }
    if (executionContext.getMetaStore().isTableFunction(functionName)) {
        return StatementExecutorResponse.handled(Optional.of(describeTableFunction(executionContext, functionName, statement.getStatementText())));
    }
    return StatementExecutorResponse.handled(Optional.of(describeNonAggregateFunction(executionContext, functionName, statement.getStatementText())));
}
Also used : FunctionName(io.confluent.ksql.name.FunctionName) DescribeFunction(io.confluent.ksql.parser.tree.DescribeFunction)

Aggregations

FunctionName (io.confluent.ksql.name.FunctionName)1 DescribeFunction (io.confluent.ksql.parser.tree.DescribeFunction)1