# US 2026/0086919 A1 · Runtime error attribution for database queries specified using a declarative database query language

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 2026/0086919 A1
- Document ID: US20260086919A1
- Status: Published application
- Kind: A1
- Application number: 19/344,282
- Filed: 2025-09-29
- Published: 2026-03-26
- Earliest claimed: 2023-01-29
- Assignees: Databricks, Inc.
- Applicants: Databricks, Inc.
- Inventors: Gengliang Wang; Wenchen Fan; Serge Rielau; Entong Shen
- Web page: https://patentgrep.com/patent/US20260086919A1

## CPC

- G06F 11/3612: {by runtime analysis (performance monitoring G06F11/3466)}
- G06F 16/258: {Data format conversion from or to a database}
- G06F 16/9024: {Graphs; Linked lists (G06F16/9027 takes precedence)}
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

A device may receive, from a user interface of a client device, a database query specified using a declarative database query language. A device may generate code based on the database query, wherein the generated code represents sets of instructions for executing the database query. A device may generate an error attribution mapping that maps sets of instructions to origins of the sets of instructions, wherein the error attribution mapping is filtered by eliminating one or more origins from the error attribution mapping. A device may determine a runtime error caused by executing the generated code. A device may identify one or more origins of the runtime error in the database query based on the error attribution mapping. A device may display information describing the one or more origins of the runtime error on the user interface of the client device.

## Claims

### Claim 1

A computer-implemented method for error attribution in database queries, the computer-implemented method comprising:
receiving, from a user interface of a client device, a database query specified using a declarative database query language;
generating code based on the database query, wherein the generated code represents sets of instructions for executing the database query;
generating an error attribution mapping that maps sets of instructions to origins of the sets of instructions, wherein the error attribution mapping is filtered by eliminating one or more origins from the error attribution mapping;
determining a runtime error caused by executing the generated code;
identifying one or more origins of the runtime error in the database query based on the error attribution mapping; and
displaying information describing the one or more origins of the runtime error on the user interface of the client device, wherein the user interface distinguishes the one or more origins of the runtime error in the database query from remaining portions of the database query.

### Claim 2 (depends on 1)

The computer-implemented method of claim 1, further comprising:
generating a graph data structure representing the database query; and
transforming the graph data structure representing the databased query.

### Claim 3 (depends on 2)

The computer-implemented method of claim 2, further comprising:
generating an execution plan from the transformed graph data structure, the execution plan comprising nodes representing computations; and
determining origins of nodes of the execution plan based on origins determined for nodes of the transformed graph data structure.

### Claim 4 (depends on 3)

The computer-implemented method of claim 3, wherein generating the executing plan comprises:
generating a logical execution plan from the transformed graph data structure;
generating a physical execution plan from the logical execution plan;
determining a mapping of nodes of a physical execution plan to nodes of the logical execution plan; and
determining origins of nodes of the physical execution plan based on the mapping of nodes of the physical execution plan to nodes of the logical execution plan.

### Claim 5 (depends on 1)

The computer-implemented method of claim 1, further comprising:
filtering the error attribution mapping by eliminating one or more origins form the error attribution mapping, wherein the elimination is performed based on a likelihood of the set of instructions causing runtime errors.

### Claim 6 (depends on 1)

The computer-implemented method of claim 1, further comprising:
determining a mapping from sets of instructions of generated code to origins in the database query, wherein a set of instructions is mapped to a particular origin representing a particular portion of the database query responsive to the set of instructions being generated based on the particular portion of database query.

### Claim 7 (depends on 6)

The computer-implemented method of claim 6, wherein determining the one or more origins of the runtime error in the database query comprises accessing the mapping to determine origins mapped to the set of instructions that caused the runtime error.

### Claim 8 (depends on 1)

The computer-implemented method of claim 1, wherein the generated code is executed by a plurality of processing node in parallel.

### Claim 9 (depends on 1)

The computer-implemented method of claim 1, wherein the information describing for each of the one or more origins of the runtime error is represented as a line number of the database query and a position within a line of the database query corresponding to the line number.

### Claim 10 (depends on 1)

The computer-implemented method of claim 1, wherein the displaying information describing the one or more origins of the runtime error further comprising:
for each origin, highlighting a portion of the database query that represents the origin by modifying representations of that portion of the database query.

### Claim 11 (depends on 10)

The computer-implemented method of claim 10, wherein highlighting the portion of the database query, includes one or more visual techniques such as changing font, underlining and highlighting.

### Claim 12 (depends on 1)

The computer-implemented method of claim 1, wherein the database query is divided into a plurality of portions of the database queries, each portion of the database query having an origin identifier wherein an origin is represented as an origin identifier corresponding to a portion of the database query.

### Claim 13 (depends on 1)

The computer-implemented method of claim 1, wherein the database query includes a plurality of subqueries, wherein an origin of the runtime error identifies a particular subquery from the plurality of subqueries.

### Claim 14 (depends on 1)

The computer-implemented method of claim 1, wherein the database query processes one or more functions specified using the database query language, wherein an origin identifies a particular function and a location within the particular function.

### Claim 15

A non-transitory computer-readable storage medium for storing instructions that when executed by one or more computer processors cause the one or more computer processors to:
receive, from a user interface of a client device, a database query specified using a declarative database query language;
generate code based on the database query, wherein the generated code represents sets of instructions for executing the database query;
generate an error attribution mapping that maps sets of instructions to origins of the sets of instructions, wherein the error attribution mapping is filtered by eliminating one or more origins from the error attribution mapping;
determine a runtime error caused by executing the generated code;
identify one or more origins of the runtime error in the database query based on the error attribution mapping; and
display information describing the one or more origins of the runtime error on the user interface of the client device, wherein the user interface distinguishes the one or more origins of the runtime error in the database query from remaining portions of the database query.

### Claim 16 (depends on 15)

The non-transitory computer-readable storage medium of claim 15, wherein the generated code is executed by a plurality of processing node in parallel.

### Claim 17 (depends on 15)

The non-transitory computer-readable storage medium of claim 15, wherein the information describing for each of the one or more origins of the runtime error is represented as a line number of the database query and a position within a line of the database query corresponding to the line number.

### Claim 18 (depends on 15)

The non-transitory computer-readable storage medium of claim 15, wherein the displaying information describing the one or more origins of the runtime error further comprising:
for each origin, highlighting a portion of the database query that represents the origin by modifying representations of that portion of the database query.

### Claim 19 (depends on 18)

The non-transitory computer-readable storage medium of claim 18, wherein highlighting the portion of the database query, includes one or more visual techniques such as changing font, underlining and highlighting.

### Claim 20

A computer system comprising:
one or more computer processors; and
a non-transitory computer-readable storage medium for storing instructions that when executed by the one or more computer processors cause the one or more computer processors to:
receive, from a user interface of a client device, a database query specified using a declarative database query language;
generate code based on the database query, wherein the generated code represents sets of instructions for executing the database query;
generate an error attribution mapping that maps sets of instructions to origins of the sets of instructions, wherein the error attribution mapping is filtered by eliminating one or more origins from the error attribution mapping;
determine a runtime error caused by executing the generated code;
identify one or more origins of the runtime error in the database query based on the error attribution mapping; and
display information describing the one or more origins of the runtime error on the user interface of the client device, wherein the user interface distinguishes the one or more origins of the runtime error in the database query from remaining portions of the database query.
