Package org.apache.druid.sql.http
Class SqlQuery
java.lang.Object
org.apache.druid.sql.http.SqlQuery
See
ClientSqlQuery for the equivalent POJO class used on the client side to interact with the Broker.
Note: The fields resultFormat and parameters rely on Calcite data types,
preventing this class from being moved to the processing module for reuse.-
Constructor Summary
ConstructorsConstructorDescriptionSqlQuery(String query, ResultFormat resultFormat, boolean header, boolean typesHeader, boolean sqlTypesHeader, Map<String, Object> context, List<SqlParameter> parameters) -
Method Summary
Modifier and TypeMethodDescriptionbooleanstatic SqlQueryfrom(com.sun.jersey.api.core.HttpContext httpContext) For BROKERs to use.static SqlQueryfrom(javax.servlet.http.HttpServletRequest request, com.fasterxml.jackson.databind.ObjectMapper objectMapper) For Router to useList<org.apache.calcite.avatica.remote.TypedValue>static List<org.apache.calcite.avatica.remote.TypedValue>getParameterList(List<SqlParameter> parameters) getQuery()inthashCode()booleanbooleanbooleantoString()withOverridenContext(Map<String, Object> overridenContext) withQueryContext(Map<String, Object> newContext)
-
Constructor Details
-
SqlQuery
public SqlQuery(String query, @Nullable ResultFormat resultFormat, boolean header, boolean typesHeader, boolean sqlTypesHeader, @Nullable Map<String, Object> context, @Nullable List<SqlParameter> parameters)
-
-
Method Details
-
getParameterList
public static List<org.apache.calcite.avatica.remote.TypedValue> getParameterList(List<SqlParameter> parameters) -
withOverridenContext
-
getQuery
-
getResultFormat
-
includeHeader
public boolean includeHeader() -
includeTypesHeader
public boolean includeTypesHeader() -
includeSqlTypesHeader
public boolean includeSqlTypesHeader() -
getContext
-
queryContext
-
getParameters
-
getParameterList
-
equals
-
hashCode
public int hashCode() -
toString
-
withQueryContext
-
from
For BROKERs to use.Brokers use com.sun.jersey upon Jetty for RESTful API, however jersey intØernally has special handling for x-www-form-urlencoded, it's not able to get the data from the stream of HttpServletRequest for such content type. So we use HttpContext to get the request entity/string instead of using HttpServletRequest.
- Throws:
HttpException- if the content type is not supported or the SQL query is malformed
-
from
public static SqlQuery from(javax.servlet.http.HttpServletRequest request, com.fasterxml.jackson.databind.ObjectMapper objectMapper) throws HttpException For Router to use- Throws:
HttpException- if the content type is not supported or the SQL query is malformed
-