Class RequestUtils
- java.lang.Object
-
- org.apache.pinot.common.utils.request.RequestUtils
-
public class RequestUtils extends Object
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static FilterQueryTreebuildFilterQuery(Integer id, Map<Integer,FilterQuery> queryMap)static ExpressioncreateIdentifierExpression(String identifier)Creates Expression from identifierstatic ExpressioncreateLiteralExpression(LiteralAstNode value)Creates Literal Expression from LiteralAstNode.static ExpressioncreateNewLiteralExpression()static voidgenerateFilterFromTree(FilterQueryTree filterQueryTree, BrokerRequest request)Generates thrift compliant filterQuery and populate it in the broker requeststatic FilterQueryTreegenerateFilterQueryTree(BrokerRequest request)Generate FilterQueryTree from Broker Requeststatic ExpressiongetExpression(AstNode astNode)Returns the expression from a givenAstNode, which can be one of the following:FunctionCallAstNodeLiteralAstNodePredicateAstNodestatic ExpressiongetFunctionExpression(String operator)static ExpressiongetIdentifierExpression(String identifier)static ExpressiongetLiteralExpression(boolean value)static ExpressiongetLiteralExpression(byte[] value)static ExpressiongetLiteralExpression(double value)static ExpressiongetLiteralExpression(long value)static ExpressiongetLiteralExpression(Object object)static ExpressiongetLiteralExpression(String value)static ExpressiongetLiteralExpression(org.apache.calcite.sql.SqlLiteral node)static StringprettyPrint(Expression expression)
-
-
-
Method Detail
-
generateFilterFromTree
public static void generateFilterFromTree(FilterQueryTree filterQueryTree, BrokerRequest request)
Generates thrift compliant filterQuery and populate it in the broker request- Parameters:
filterQueryTree-request-
-
createIdentifierExpression
public static Expression createIdentifierExpression(String identifier)
Creates Expression from identifier- Parameters:
identifier-- Returns:
-
createLiteralExpression
public static Expression createLiteralExpression(LiteralAstNode value)
Creates Literal Expression from LiteralAstNode.- Parameters:
value-- Returns:
-
getIdentifierExpression
public static Expression getIdentifierExpression(String identifier)
-
getLiteralExpression
public static Expression getLiteralExpression(org.apache.calcite.sql.SqlLiteral node)
-
createNewLiteralExpression
public static Expression createNewLiteralExpression()
-
getLiteralExpression
public static Expression getLiteralExpression(boolean value)
-
getLiteralExpression
public static Expression getLiteralExpression(long value)
-
getLiteralExpression
public static Expression getLiteralExpression(double value)
-
getLiteralExpression
public static Expression getLiteralExpression(String value)
-
getLiteralExpression
public static Expression getLiteralExpression(byte[] value)
-
getLiteralExpression
public static Expression getLiteralExpression(Object object)
-
getFunctionExpression
public static Expression getFunctionExpression(String operator)
-
generateFilterQueryTree
public static FilterQueryTree generateFilterQueryTree(BrokerRequest request)
Generate FilterQueryTree from Broker Request- Parameters:
request- Broker Request- Returns:
-
buildFilterQuery
public static FilterQueryTree buildFilterQuery(Integer id, Map<Integer,FilterQuery> queryMap)
-
getExpression
public static Expression getExpression(AstNode astNode)
Returns the expression from a givenAstNode, which can be one of the following:- Returns:
- Expression
-
prettyPrint
public static String prettyPrint(Expression expression)
-
-