public class ViewExpanderImpl implements ViewExpander {
public RelNode expandView(RelDataType rowType, String queryString,
List<String> schemaPath) {
final SqlParser parser = SqlParser.create(parserFactory, queryString,
lex.quoting, lex.unquotedCasing, lex.quotedCasing);
SqlNode sqlNode;
try {
sqlNode = parser.parseQuery();
} catch (SqlParseException e) {
throw new RuntimeException("parse failed", e);
}
final OptiqCatalogReader catalogReader =
createCatalogReader().withSchemaPath(schemaPath);
final SqlValidator validator = new OptiqSqlValidator(operatorTable,
catalogReader, typeFactory);
final SqlNode validatedSqlNode = validator.validate(sqlNode);
final SqlToRelConverter sqlToRelConverter = new SqlToRelConverter(
null, validator, catalogReader, planner,
createRexBuilder(), convertletTable);
sqlToRelConverter.setTrimUnusedFields(false);