use of org.voltdb.expressions.TupleValueExpression in project voltdb by VoltDB.
the class StmtTargetTableScan method findPartitioningColumns.
private List<SchemaColumn> findPartitioningColumns() {
if (m_partitioningColumns != null) {
return m_partitioningColumns;
}
if (getIsReplicated()) {
return null;
}
Column partitionCol = m_table.getPartitioncolumn();
// because it has no recognized partitioning join key.
if (partitionCol == null) {
return null;
}
String tbName = m_table.getTypeName();
TupleValueExpression tve = new TupleValueExpression(tbName, m_tableAlias, partitionCol, partitionCol.getIndex());
String colName = partitionCol.getTypeName();
SchemaColumn scol = new SchemaColumn(tbName, m_tableAlias, colName, colName, tve);
m_partitioningColumns = new ArrayList<SchemaColumn>();
m_partitioningColumns.add(scol);
return m_partitioningColumns;
}
use of org.voltdb.expressions.TupleValueExpression in project voltdb by VoltDB.
the class AbstractReceivePlanNode method resolveColumnIndexes.
protected void resolveColumnIndexes(NodeSchema outputSchema) {
// Need to order and resolve indexes of output columns
assert (m_children.size() == 1);
AbstractPlanNode childNode = m_children.get(0);
childNode.resolveColumnIndexes();
NodeSchema inputSchema = childNode.getOutputSchema();
assert (inputSchema.equals(outputSchema));
for (SchemaColumn col : 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);
}
// output schema for ReceivePlanNode should never be re-sorted
}
use of org.voltdb.expressions.TupleValueExpression in project voltdb by VoltDB.
the class AbstractScanPlanNode method setScanColumns.
protected void setScanColumns(List<SchemaColumn> scanColumns) {
assert (scanColumns != null);
int i = 0;
for (SchemaColumn col : scanColumns) {
TupleValueExpression tve = (TupleValueExpression) col.getExpression();
int difftor = tve.getDifferentiator();
m_differentiatorMap.put(difftor, i);
SchemaColumn clonedCol = col.clone();
clonedCol.setDifferentiator(i);
m_tableScanSchema.addColumn(clonedCol);
++i;
}
}
use of org.voltdb.expressions.TupleValueExpression in project voltdb by VoltDB.
the class StmtTableScan method resolveTVE.
public AbstractExpression resolveTVE(TupleValueExpression tve) {
AbstractExpression resolvedExpr = processTVE(tve, tve.getColumnName());
List<TupleValueExpression> tves = ExpressionUtil.getTupleValueExpressions(resolvedExpr);
for (TupleValueExpression subqTve : tves) {
resolveLeafTve(subqTve);
}
return resolvedExpr;
}
use of org.voltdb.expressions.TupleValueExpression in project voltdb by VoltDB.
the class TestIndexSelection method checkIndexPredicateDoesNotHave.
private void checkIndexPredicateDoesNotHave(AbstractPlanNode pn, String... columns) {
assertEquals(1, pn.getChildCount());
pn = pn.getChild(0);
assertEquals(PlanNodeType.INDEXSCAN, pn.getPlanNodeType());
IndexScanPlanNode ipn = (IndexScanPlanNode) pn;
AbstractExpression pred = ipn.getPredicate();
assertNotNull(pred);
List<TupleValueExpression> tves = pred.findAllTupleValueSubexpressions();
for (TupleValueExpression tve : tves) {
for (String column : columns) {
assertFalse(tve.getColumnName().equals(column));
}
}
}
Aggregations