Skip to content

Commit

Permalink
Inline analyzeExpressions method
Browse files Browse the repository at this point in the history
There's only one caller, so no need for an extra indirection.
  • Loading branch information
martint committed Mar 9, 2019
1 parent 31a6f75 commit 2a23e10
Showing 1 changed file with 1 addition and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1480,27 +1480,13 @@ public static ExpressionAnalysis analyzeExpressions(
List<Expression> parameters,
WarningCollector warningCollector,
boolean isDescribe)
{
return analyzeExpressions(session, metadata, sqlParser, new RelationType(), types, expressions, parameters, warningCollector, isDescribe);
}

private static ExpressionAnalysis analyzeExpressions(
Session session,
Metadata metadata,
SqlParser sqlParser,
RelationType tupleDescriptor,
TypeProvider types,
Iterable<? extends Expression> expressions,
List<Expression> parameters,
WarningCollector warningCollector,
boolean isDescribe)
{
// expressions at this point can not have sub queries so deny all access checks
// in the future, we will need a full access controller here to verify access to functions
Analysis analysis = new Analysis(null, parameters, isDescribe);
ExpressionAnalyzer analyzer = create(analysis, session, metadata, sqlParser, new DenyAllAccessControl(), types, warningCollector);
for (Expression expression : expressions) {
analyzer.analyze(expression, Scope.builder().withRelationType(RelationId.anonymous(), tupleDescriptor).build());
analyzer.analyze(expression, Scope.builder().withRelationType(RelationId.anonymous(), new RelationType()).build());
}

return new ExpressionAnalysis(
Expand Down

0 comments on commit 2a23e10

Please sign in to comment.