KeyValueSchema schema = ProjectedColumnExpression.buildSchema(dataColumns);
// Set key value schema of the data columns.
serializeSchemaIntoScan(scan, schema);
String schemaName = context.getCurrentTable().getTable().getSchemaName().getString();
String parentTable = context.getCurrentTable().getTable().getParentTableName().getString();
final ParseNodeFactory FACTORY = new ParseNodeFactory();
TableRef dataTableRef =
FromCompiler.getResolver(
FACTORY.namedTable(null, TableName.create(schemaName, parentTable)),
context.getConnection()).resolveTable(schemaName, parentTable);
PTable dataTable = dataTableRef.getTable();
// Set index maintainer of the local index.
serializeIndexMaintainerIntoScan(scan, dataTable);
// Set view constants if exists.