Search in sources :

Example 26 with OneRowActionListener

use of io.crate.execution.support.OneRowActionListener in project crate by crate.

the class AlterTableAddColumnPlan method executeOrFail.

@Override
public void executeOrFail(DependencyCarrier dependencies, PlannerContext plannerContext, RowConsumer consumer, Row params, SubQueryResults subQueryResults) throws Exception {
    BoundAddColumn stmt = bind(alterTable, plannerContext.transactionContext(), dependencies.nodeContext(), params, subQueryResults, dependencies.fulltextAnalyzerResolver());
    dependencies.alterTableOperation().executeAlterTableAddColumn(stmt).whenComplete(new OneRowActionListener<>(consumer, rCount -> new Row1(rCount == null ? -1 : rCount)));
}
Also used : AnalyzedColumnDefinition(io.crate.analyze.AnalyzedColumnDefinition) HashMap(java.util.HashMap) ObjectType(io.crate.types.ObjectType) Function(java.util.function.Function) ArrayList(java.util.ArrayList) DependencyCarrier(io.crate.planner.DependencyCarrier) SymbolEvaluator(io.crate.analyze.SymbolEvaluator) Settings(org.elasticsearch.common.settings.Settings) Locale(java.util.Locale) Map(java.util.Map) OneRowActionListener(io.crate.execution.support.OneRowActionListener) AnalyzedAlterTableAddColumn(io.crate.analyze.AnalyzedAlterTableAddColumn) FulltextAnalyzerResolver(io.crate.metadata.FulltextAnalyzerResolver) LinkedHashSet(java.util.LinkedHashSet) DocSysColumns(io.crate.metadata.doc.DocSysColumns) DocTableInfo(io.crate.metadata.doc.DocTableInfo) TableInfo(io.crate.metadata.table.TableInfo) NodeContext(io.crate.metadata.NodeContext) BoundAddColumn(io.crate.analyze.BoundAddColumn) ColumnIdent(io.crate.metadata.ColumnIdent) Reference(io.crate.metadata.Reference) CheckConstraint(io.crate.sql.tree.CheckConstraint) RowConsumer(io.crate.data.RowConsumer) Objects(java.util.Objects) AnalyzedTableElements(io.crate.analyze.AnalyzedTableElements) List(java.util.List) Row(io.crate.data.Row) Symbol(io.crate.expression.symbol.Symbol) PlannerContext(io.crate.planner.PlannerContext) Plan(io.crate.planner.Plan) SubQueryResults(io.crate.planner.operators.SubQueryResults) VisibleForTesting(io.crate.common.annotations.VisibleForTesting) Comparator(java.util.Comparator) Row1(io.crate.data.Row1) CoordinatorTxnCtx(io.crate.metadata.CoordinatorTxnCtx) Row1(io.crate.data.Row1) BoundAddColumn(io.crate.analyze.BoundAddColumn)

Aggregations

Row1 (io.crate.data.Row1)26 OneRowActionListener (io.crate.execution.support.OneRowActionListener)26 Row (io.crate.data.Row)22 RowConsumer (io.crate.data.RowConsumer)22 SubQueryResults (io.crate.planner.operators.SubQueryResults)22 DependencyCarrier (io.crate.planner.DependencyCarrier)19 Plan (io.crate.planner.Plan)19 PlannerContext (io.crate.planner.PlannerContext)19 SymbolEvaluator (io.crate.analyze.SymbolEvaluator)15 Symbol (io.crate.expression.symbol.Symbol)15 Function (java.util.function.Function)15 VisibleForTesting (io.crate.common.annotations.VisibleForTesting)11 NodeContext (io.crate.metadata.NodeContext)10 Settings (org.elasticsearch.common.settings.Settings)10 CoordinatorTxnCtx (io.crate.metadata.CoordinatorTxnCtx)9 List (java.util.List)7 RelationName (io.crate.metadata.RelationName)6 DocTableInfo (io.crate.metadata.doc.DocTableInfo)6 Table (io.crate.sql.tree.Table)6 ArrayList (java.util.ArrayList)5