use of org.voltdb.expressions.TupleValueExpression in project voltdb by VoltDB.
the class NodeSchema method replaceTableClone.
public NodeSchema replaceTableClone(String tableAlias) {
NodeSchema copy = new NodeSchema();
for (int colIndex = 0; colIndex < m_columns.size(); ++colIndex) {
SchemaColumn column = m_columns.get(colIndex);
String colAlias = column.getColumnAlias();
int differentiator = column.getDifferentiator();
TupleValueExpression tve = new TupleValueExpression(tableAlias, tableAlias, colAlias, colAlias, colIndex, differentiator);
tve.setTypeSizeAndInBytes(column);
copy.addColumn(tableAlias, tableAlias, colAlias, colAlias, tve, differentiator);
}
return copy;
}
use of org.voltdb.expressions.TupleValueExpression in project voltdb by VoltDB.
the class OrderByPlanNode method resolveColumnIndexes.
@Override
public void resolveColumnIndexes() {
// the sort columns
assert (m_children.size() == 1);
AbstractPlanNode childNode = m_children.get(0);
childNode.resolveColumnIndexes();
NodeSchema inputSchema = childNode.getOutputSchema();
for (SchemaColumn col : m_outputSchema.getColumns()) {
AbstractExpression colExpr = col.getExpression();
// At this point, they'd better all be TVEs.
assert (colExpr instanceof TupleValueExpression);
TupleValueExpression tve = (TupleValueExpression) colExpr;
tve.setColumnIndexUsingSchema(inputSchema);
}
m_outputSchema.sortByTveIndex();
resolveSortIndexesUsingSchema(inputSchema);
}
use of org.voltdb.expressions.TupleValueExpression in project voltdb by VoltDB.
the class WindowFunctionPlanNode method generateOutputSchema.
@Override
public void generateOutputSchema(Database db) {
// We only expect one window function here.
assert (getAggregateFunctionCount() == 1);
if (m_outputSchema == null) {
m_outputSchema = new NodeSchema();
} else {
assert (getOutputSchema().size() == 0);
}
assert (m_children.size() == 1);
m_children.get(0).generateOutputSchema(db);
NodeSchema inputSchema = m_children.get(0).getOutputSchema();
// We already created the TVE for this expression.
for (int ii = 0; ii < getAggregateFunctionCount(); ii += 1) {
TupleValueExpression tve = m_outputTVEs.get(ii);
getOutputSchema().addColumn(tve.getTableName(), tve.getTableAlias(), tve.getColumnName(), tve.getColumnAlias(), tve);
}
// Just copy the input columns to the output schema.
for (SchemaColumn col : inputSchema.getColumns()) {
getOutputSchema().addColumn(col.clone());
}
m_hasSignificantOutputSchema = true;
}
Aggregations