// We use the optimizer to be able to produce a semantic exception if columns are referenced in the expression.
// We can't do this with the interpreter yet because it's designed for the execution stage and has the wrong shape.
// So, for now, we punt on supporting non-deterministic functions.
ExpressionInterpreter samplePercentageEval = ExpressionInterpreter.expressionOptimizer(relation.getSamplePercentage(), metadata, session);
Object samplePercentageObject = samplePercentageEval.optimize(new SymbolResolver()
{
@Override
public Object getValue(Symbol symbol)
{
throw new SemanticException(NON_NUMERIC_SAMPLE_PERCENTAGE, relation.getSamplePercentage(), "Sample percentage cannot contain column references");