Class SqlQuery

java.lang.Object
org.apache.druid.sql.http.SqlQuery

public class SqlQuery extends Object
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 Details

  • Method Details

    • getParameterList

      public static List<org.apache.calcite.avatica.remote.TypedValue> getParameterList(List<SqlParameter> parameters)
    • withOverridenContext

      public SqlQuery withOverridenContext(Map<String,Object> overridenContext)
    • getQuery

      public String getQuery()
    • getResultFormat

      public ResultFormat getResultFormat()
    • includeHeader

      public boolean includeHeader()
    • includeTypesHeader

      public boolean includeTypesHeader()
    • includeSqlTypesHeader

      public boolean includeSqlTypesHeader()
    • getContext

      public Map<String,Object> getContext()
    • queryContext

      public QueryContext queryContext()
    • getParameters

      public List<SqlParameter> getParameters()
    • getParameterList

      public List<org.apache.calcite.avatica.remote.TypedValue> getParameterList()
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • withQueryContext

      public SqlQuery withQueryContext(Map<String,Object> newContext)
    • from

      public static SqlQuery from(com.sun.jersey.api.core.HttpContext httpContext) throws HttpException
      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