Skip to content

Discovery API: Return distinct error message for queries over max length #1276

Description

@LtChae

What

  • Discovery API returns a 400 response and a descriptive error message when exceeding presto's max query length

Why

As a data consumer I would like to receive descriptive, actionable errors so that I can fix issues with queries I am developing.

Notes:

Queries are sent to presto in the header of the request.
See below for error example.

     {:ok,
         %Tesla.Env{
           __client__: %Tesla.Client{adapter: nil, fun: nil, post: [], pre: []},
           __module__: Prestige.Client.RequestStream,
           body: "<h1>Bad Message 431</h1><pre>reason: Request Header Fields Too Large</pre>",
           headers: [
             {"content-type", "text/html;charset=iso-8859-1"},
             {"content-length", "74"},
             {"connection", "close"}
           ],
           method: :post,
           opts: [],
           query: [],
           status: 431,
           url: "http://kdp-kubernetes-data-platform-presto.kdp:8080/v1/statement"
         }}

Tested with a query over 6900 characters

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions