}
public void testSelectionOfArithmeticExpressions() throws Exception {
Query query = QueryBuilder.getInstance().parseQuery("SELECT ((c1+c2)/c3*c4)-(c5/c6+year(c7))");
ScalarFunctionColumn col1 = new ScalarFunctionColumn(
Lists.<AbstractColumn>newArrayList(new SimpleColumn("c1"),
new SimpleColumn("c2")), Sum.getInstance());
ScalarFunctionColumn col2 = new ScalarFunctionColumn(
Lists.<AbstractColumn>newArrayList(col1, new SimpleColumn("c3")),
Quotient.getInstance());
ScalarFunctionColumn col3 = new ScalarFunctionColumn(
Lists.<AbstractColumn>newArrayList(col2, new SimpleColumn("c4")),
Product.getInstance());
ScalarFunctionColumn col4 = new ScalarFunctionColumn(
Lists.<AbstractColumn>newArrayList(new SimpleColumn("c5"),
new SimpleColumn("c6")), Quotient.getInstance());
ScalarFunctionColumn col5 = new ScalarFunctionColumn(
Lists.<AbstractColumn>newArrayList(col4,
new ScalarFunctionColumn(Lists.<AbstractColumn>newArrayList(
new SimpleColumn("c7")), TimeComponentExtractor.getInstance(
TimeComponentExtractor.TimeComponent.YEAR))),
Sum.getInstance());
ScalarFunctionColumn col6 = new ScalarFunctionColumn(
Lists.<AbstractColumn>newArrayList(col3, col5),
Difference.getInstance());