Skip to content

[META] Error Handling Enhancements #5261

@Swiddis

Description

@Swiddis

This is a meta issue collecting a few different ideas from different sources.

The core problem is that misbehaving queries are typically hard to debug & require a lot of knowledge of PPL/SQL engine behavior, and there's room for enhancement.

Discussing the concept with @anasalkouz, there are three main problem classes we want to enhance:

  1. Something went wrong (execution error)
  2. 0 results are returned, why?
  3. The query is slow, why?

So, compiling existing issues for the backend:

Once those have reasonably complete implementations, errors will be in structured reports like this:

{
  "status": 400,
  "error": {
    "type": "SemanticCheckException",
    "code": "FIELD_NOT_FOUND",
    "reason": "Invalid Query",
    "details": "Failed to resolve field 'foo'",
    "location": [
      "while planning the query",
      "while resolving fields in the index mapping"
    ],
    "context": {
      "index_pattern": "logs-*",
      "position": {"line": 1, "column": 25},
      "query": "source=logs-* | fields foo",
      "query_id": "b6627794-3939-4ac4-8c5b-821ccc400f4f"
    },
    "suggestion": "Did you mean: 'foobar'"
  }
}

Frontends can choose to do whatever they want with this: render specific fixed pieces of context (e.g. position is pointing to a spot in the query, highlight it?), render details/locations/suggestions, throw it in an LLM, etc. It also helps with oncall debugging when given these responses (either directly or from har files). #4919 (comment) shows me doing this quickly for the SQL CLI based on a proof-of-concept implementation.

From the frontend, there's a separate meta issue:

Once the core flows here are done, what's left is to start vetting specific error cases:

Metadata

Metadata

Assignees

Labels

PPLPiped processing languageRFCRequest For Commentserror-experienceIssues related to how we handle failure cases in the plugin.

Type

No type

Projects

Status

New

Status

Not Started

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions