First of all, the SQL fragment you are passing is not correct. You are missing a closing parenthesis. Next, the aliases that it should use is provided by you through the third parameter new String[] {sp.getIname()}
. As far as I understand, the alias has to be included in the SQL fragment by you. If you want the table alias to be prefixed, you can use the placeholder {alias}
. I think this should look like the following:
Projection dp = Projections.sqlGroupProjection("CAST({alias}."+sp.getIname()+" AS DATE) as "+sp.getIname(),
"CAST({alias}."+sp.getIname()+" AS DATE)",
new String[] {sp.getIname()},
new Type[] {StandardBasicTypes.DATE});