LOG.info("test PSC: subexpressions in inputTupleSchema");
List<ColumnNameType> inputTupleSchema = new ArrayList<ColumnNameType>();
//from left parent
inputTupleSchema.add(new ColumnNameType("SUPPLIER.SUPPKEY", _lc));
inputTupleSchema.add(new ColumnNameType("N1.NAME", _sc));
//from right parent
inputTupleSchema.add(new ColumnNameType("LINEITEM.ORDERKEY", _lc));
//inputTupleSchema.add(new ColumnNameType("LINEITEM.SUPPKEY", _lc)); - join key
inputTupleSchema.add(new ColumnNameType("LINEITEM.EXTENDEDPRICE", _dblConv));
inputTupleSchema.add(new ColumnNameType("1.0 - LINEITEM.DISCOUNT", _dblConv));
inputTupleSchema.add(new ColumnNameType("LINEITEM.SHIPDATE", _ic));
EquiJoinComponent L_S_Njoin = createTPCH7_LSNSubplan();
ProjSchemaCreator psc = new ProjSchemaCreator(_globalProject, new TupleSchema(inputTupleSchema), L_S_Njoin, _parsedQuery, _schema);
psc.create();
List<ColumnNameType> outputTupleSchema = psc.getOutputSchema().getSchema();
ProjectOperator projectOperator = psc.getProjectOperator();
//expected results
List<ColumnNameType> expOutputTupleSchema = new ArrayList<ColumnNameType>();
expOutputTupleSchema.add(new ColumnNameType("N1.NAME", _sc)); //1
expOutputTupleSchema.add(new ColumnNameType("EXTRACT_YEAR(LINEITEM.SHIPDATE)", _ic)); //5
expOutputTupleSchema.add(new ColumnNameType("LINEITEM.EXTENDEDPRICE * (1.0 - LINEITEM.DISCOUNT)", _dblConv)); //3, 4
expOutputTupleSchema.add(new ColumnNameType("LINEITEM.ORDERKEY", _lc)); //2
ProjectOperator expProjectOperator = new ProjectOperator(new ColumnReference(_sc, 1, "N1.NAME"),
new IntegerYearFromDate(new ColumnReference(_dateConv, 5, "LINEITEM.SHIPDATE")),
new Multiplication(
new ColumnReference(_dblConv, 3, "LINEITEM.EXTENDEDPRICE"),
new ColumnReference(_dblConv, 4, "1.0 - LINEITEM.DISCOUNT")