use of com.yahoo.elide.datastores.aggregation.queryengines.sql.expression.JoinExpressionExtractor in project elide by yahoo.
the class QueryTranslator method extractJoinExpressions.
/**
* Get required join expressions for given column in given Query.
* @param column {@link ColumnProjection}
* @param query Expanded Query.
* @return A set of Join expressions that capture a relationship traversal.
*/
private Set<String> extractJoinExpressions(ColumnProjection column, Query query) {
Set<String> joinExpressions = new LinkedHashSet<>();
ColumnContext context = ColumnContext.builder().queryable(query).alias(query.getSource().getAlias()).metaDataStore(metaDataStore).column(column).tableArguments(query.getArguments()).build();
JoinExpressionExtractor visitor = new JoinExpressionExtractor(context);
List<Reference> references = parser.parse(query.getSource(), column);
references.forEach(ref -> joinExpressions.addAll(ref.accept(visitor)));
return joinExpressions;
}
Aggregations