Search in sources :

Example 1 with JdbcColumnHandle

use of com.facebook.presto.plugin.jdbc.JdbcColumnHandle in project presto by prestodb.

the class JdbcFilterToSqlTranslator method translateVariable.

@Override
public TranslatedExpression<JdbcExpression> translateVariable(VariableReferenceExpression variable, Map<VariableReferenceExpression, ColumnHandle> context, RowExpressionTreeTranslator<JdbcExpression, Map<VariableReferenceExpression, ColumnHandle>> rowExpressionTreeTranslator) {
    JdbcColumnHandle columnHandle = (JdbcColumnHandle) context.get(variable);
    requireNonNull(columnHandle, format("Unrecognized variable %s", variable));
    return new TranslatedExpression<>(Optional.of(new JdbcExpression(quote + columnHandle.getColumnName().replace(quote, quote + quote) + quote)), variable, ImmutableList.of());
}
Also used : JdbcColumnHandle(com.facebook.presto.plugin.jdbc.JdbcColumnHandle) TranslatedExpression(com.facebook.presto.expressions.translator.TranslatedExpression)

Aggregations

TranslatedExpression (com.facebook.presto.expressions.translator.TranslatedExpression)1 JdbcColumnHandle (com.facebook.presto.plugin.jdbc.JdbcColumnHandle)1