Search in sources :

Example 1 with DenyAllAccessControl

use of com.facebook.presto.security.DenyAllAccessControl in project presto by prestodb.

the class ExpressionAnalyzer method analyzeExpressions.

private static ExpressionAnalysis analyzeExpressions(Session session, Metadata metadata, SqlParser sqlParser, RelationType tupleDescriptor, Map<Symbol, Type> types, Iterable<? extends Expression> expressions, List<Expression> parameters, 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);
    for (Expression expression : expressions) {
        analyzer.analyze(expression, Scope.builder().withRelationType(tupleDescriptor).build());
    }
    return new ExpressionAnalysis(analyzer.getExpressionTypes(), analyzer.getExpressionCoercions(), analyzer.getSubqueryInPredicates(), analyzer.getScalarSubqueries(), analyzer.getExistsSubqueries(), analyzer.getColumnReferences(), analyzer.getTypeOnlyCoercions(), analyzer.getQuantifiedComparisons(), analyzer.getLambdaArgumentReferences());
}
Also used : DenyAllAccessControl(com.facebook.presto.security.DenyAllAccessControl) SubqueryExpression(com.facebook.presto.sql.tree.SubqueryExpression) SubscriptExpression(com.facebook.presto.sql.tree.SubscriptExpression) LogicalBinaryExpression(com.facebook.presto.sql.tree.LogicalBinaryExpression) SearchedCaseExpression(com.facebook.presto.sql.tree.SearchedCaseExpression) CoalesceExpression(com.facebook.presto.sql.tree.CoalesceExpression) SimpleCaseExpression(com.facebook.presto.sql.tree.SimpleCaseExpression) NotExpression(com.facebook.presto.sql.tree.NotExpression) LambdaExpression(com.facebook.presto.sql.tree.LambdaExpression) IfExpression(com.facebook.presto.sql.tree.IfExpression) QuantifiedComparisonExpression(com.facebook.presto.sql.tree.QuantifiedComparisonExpression) InListExpression(com.facebook.presto.sql.tree.InListExpression) TryExpression(com.facebook.presto.sql.tree.TryExpression) ArithmeticUnaryExpression(com.facebook.presto.sql.tree.ArithmeticUnaryExpression) DereferenceExpression(com.facebook.presto.sql.tree.DereferenceExpression) NullIfExpression(com.facebook.presto.sql.tree.NullIfExpression) ComparisonExpression(com.facebook.presto.sql.tree.ComparisonExpression) Expression(com.facebook.presto.sql.tree.Expression) ArithmeticBinaryExpression(com.facebook.presto.sql.tree.ArithmeticBinaryExpression)

Aggregations

DenyAllAccessControl (com.facebook.presto.security.DenyAllAccessControl)1 ArithmeticBinaryExpression (com.facebook.presto.sql.tree.ArithmeticBinaryExpression)1 ArithmeticUnaryExpression (com.facebook.presto.sql.tree.ArithmeticUnaryExpression)1 CoalesceExpression (com.facebook.presto.sql.tree.CoalesceExpression)1 ComparisonExpression (com.facebook.presto.sql.tree.ComparisonExpression)1 DereferenceExpression (com.facebook.presto.sql.tree.DereferenceExpression)1 Expression (com.facebook.presto.sql.tree.Expression)1 IfExpression (com.facebook.presto.sql.tree.IfExpression)1 InListExpression (com.facebook.presto.sql.tree.InListExpression)1 LambdaExpression (com.facebook.presto.sql.tree.LambdaExpression)1 LogicalBinaryExpression (com.facebook.presto.sql.tree.LogicalBinaryExpression)1 NotExpression (com.facebook.presto.sql.tree.NotExpression)1 NullIfExpression (com.facebook.presto.sql.tree.NullIfExpression)1 QuantifiedComparisonExpression (com.facebook.presto.sql.tree.QuantifiedComparisonExpression)1 SearchedCaseExpression (com.facebook.presto.sql.tree.SearchedCaseExpression)1 SimpleCaseExpression (com.facebook.presto.sql.tree.SimpleCaseExpression)1 SubqueryExpression (com.facebook.presto.sql.tree.SubqueryExpression)1 SubscriptExpression (com.facebook.presto.sql.tree.SubscriptExpression)1 TryExpression (com.facebook.presto.sql.tree.TryExpression)1