Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -744,7 +744,7 @@ public static SymbolAlias symbol(String alias)
return new SymbolAlias(alias);
}

public static PlanMatchPattern filter(String expectedPredicate, PlanMatchPattern source)
public static PlanMatchPattern filter(@Language("SQL") String expectedPredicate, PlanMatchPattern source)
{
return filter(PlanBuilder.expression(expectedPredicate), source);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@
import io.trino.testing.TestingMetadata.TestingTableHandle;
import io.trino.testing.TestingTableExecuteHandle;
import io.trino.testing.TestingTransactionHandle;
import org.intellij.lang.annotations.Language;

import java.util.ArrayList;
import java.util.Arrays;
Expand Down Expand Up @@ -1415,12 +1416,12 @@ public RemoteSourceNode remoteSource(
return new RemoteSourceNode(idAllocator.getNextId(), sourceFragmentIds, outputs, orderingScheme, exchangeType, retryPolicy);
}

public static Expression expression(String sql)
public static Expression expression(@Language("SQL") String sql)
{
return ExpressionUtils.rewriteIdentifiersToSymbolReferences(new SqlParser().createExpression(sql, new ParsingOptions()));
}

public static List<Expression> expressions(String... expressions)
public static List<Expression> expressions(@Language("SQL") String... expressions)
{
return Stream.of(expressions)
.map(PlanBuilder::expression)
Expand Down