use of io.confluent.ksql.analyzer.RewrittenAnalysis in project ksql by confluentinc.
the class KsqlEngine method analyzeQueryWithNoOutputTopic.
/**
* For analyzing queries that you know won't have an output topic, such as pull queries.
*/
public ImmutableAnalysis analyzeQueryWithNoOutputTopic(final Query query, final String queryText, final Map<String, Object> configOverrides) {
final KsqlConfig ksqlConfig = this.primaryContext.getKsqlConfig();
final QueryAnalyzer queryAnalyzer = new QueryAnalyzer(getMetaStore(), "", getRowpartitionRowoffsetEnabled(ksqlConfig, configOverrides), ksqlConfig.getBoolean(KsqlConfig.KSQL_QUERY_PULL_LIMIT_CLAUSE_ENABLED));
final Analysis analysis;
try {
analysis = queryAnalyzer.analyze(query, Optional.empty());
} catch (final KsqlException e) {
throw new KsqlStatementException(e.getMessage(), queryText, e);
}
return new RewrittenAnalysis(analysis, new QueryExecutionUtil.ColumnReferenceRewriter()::process);
}
Aggregations