use of org.teiid.language.SubqueryComparison in project teiid by teiid.
the class PhoenixExecutionFactory method translate.
/**
* Adding a specific workaround for just Pheonix and BigDecimal.
*/
@Override
public List<?> translate(LanguageObject obj, ExecutionContext context) {
if (obj instanceof SubqueryIn) {
SubqueryIn in = (SubqueryIn) obj;
return Arrays.asList(new SubqueryComparison(in.getLeftExpression(), in.isNegated() ? Operator.NE : Operator.EQ, in.isNegated() ? Quantifier.ALL : Quantifier.SOME, in.getSubquery()));
}
if (!(obj instanceof Literal)) {
return super.translate(obj, context);
}
Literal l = (Literal) obj;
if (l.isBindEligible() || l.getType() != TypeFacility.RUNTIME_TYPES.BIG_DECIMAL) {
return super.translate(obj, context);
}
BigDecimal bd = ((BigDecimal) l.getValue());
if (bd.scale() == 0) {
l.setValue(bd.setScale(1));
}
return null;
}
Aggregations