Search in sources :

Example 1 with SymbolPrinter

use of io.crate.analyze.symbol.format.SymbolPrinter in project crate by crate.

the class AnalyzedTableElements method validateGeneratedColumns.

private void validateGeneratedColumns(TableIdent tableIdent, Collection<? extends Reference> existingColumns, Functions functions, ParameterContext parameterContext, SessionContext sessionContext) {
    List<Reference> tableReferences = new ArrayList<>();
    for (AnalyzedColumnDefinition columnDefinition : columns) {
        buildReference(tableIdent, columnDefinition, tableReferences);
    }
    tableReferences.addAll(existingColumns);
    TableReferenceResolver tableReferenceResolver = new TableReferenceResolver(tableReferences);
    ExpressionAnalyzer expressionAnalyzer = new ExpressionAnalyzer(functions, sessionContext, parameterContext, tableReferenceResolver, null);
    SymbolPrinter printer = new SymbolPrinter(functions);
    ExpressionAnalysisContext expressionAnalysisContext = new ExpressionAnalysisContext();
    for (AnalyzedColumnDefinition columnDefinition : columns) {
        if (columnDefinition.generatedExpression() != null) {
            processGeneratedExpression(expressionAnalyzer, printer, columnDefinition, expressionAnalysisContext);
        }
    }
}
Also used : SymbolPrinter(io.crate.analyze.symbol.format.SymbolPrinter) ExpressionAnalysisContext(io.crate.analyze.expressions.ExpressionAnalysisContext) ExpressionAnalyzer(io.crate.analyze.expressions.ExpressionAnalyzer) TableReferenceResolver(io.crate.analyze.expressions.TableReferenceResolver)

Aggregations

ExpressionAnalysisContext (io.crate.analyze.expressions.ExpressionAnalysisContext)1 ExpressionAnalyzer (io.crate.analyze.expressions.ExpressionAnalyzer)1 TableReferenceResolver (io.crate.analyze.expressions.TableReferenceResolver)1 SymbolPrinter (io.crate.analyze.symbol.format.SymbolPrinter)1