IP Library › Granted Patent US 10,423,619
Granted Patent B2
US 10,423,619 · App. 15/363,380 · Granted Sep 24, 2019

Query plan generation for precompiled and code generating query operations

Inventors: Till Merker (Sandhausen, DE); Wolfgang Stephan (Heidelberg, DE); Mortiz Thomas (Walldorf, DE)
Assignee: SAP SE
G06F16/24542
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 10,423,619
App. No.
15/363,380
Granted
Sep 24, 2019
Kind
B2
Abstract

A system for generating a query plan is provided. In some implementations, the system performs operations comprising: translating, into corresponding code, a query operation in a query plan comprising a sequence of query operations; determining a context for the translating of the query operation, the context corresponding to whether the query operation comprises a pre-compiled query operation or a code-generating query operation; and inserting adaptor code between code for the query operation and code for one or more previous query operations in the sequence of query operations, when a change in context is detected between the translating of the query operation and a translation of the one or more previous query operations. Related methods and articles of manufacture are also described.

Claims (32)

1. A system comprising:

at least one data processor; and

at least one memory storing instructions which, when executed by the at least one data processor, result in operations comprising:

translating, into corresponding code, a query operation in a query plan comprising a sequence of query operations;

determining a context for the translating of the query operation, the context corresponding to whether the query operation comprises a pre-compiled query operation or a code-generating query operation, the context for the translating of the query operation comprising a code generating mode when the query operation comprises a code-generating query operation;

detecting a change in context between the translating of the query operation and a translation of one or more previous query operations comprising pre-compiled query operations;

in response to detecting the change in context, inserting, between code for the query operation and code for the one or more previous query operations in the sequence of query operations, adaptor code configured to decompose a data chunk output by the one or more previous query operations into a plurality of rows of data that the query operation is able to operate on.

2. The system of claim 1 , wherein the translating of the query operation comprises triggering a dynamic generation of the corresponding code for the query operation, when the context for the translating of the query operation comprises the code generating mode.

3. The system of claim 1 , wherein the context for translating the query operation comprises a non-code generating mode, when the query operation comprises a pre-compiled query operation.

4. The system of claim 3 , wherein the translating of the query operation comprises inserting, into code for the query plan, existing code for the query operation, when the context for the translating of the query operation comprises the non-code generating mode.

5. The system of claim 3 , further comprising:

responding to the change in the context between the translating of the query operation and the translation of the one or more previous query operations comprising code-generating query operations by at least inserting, between the code for the query operation and the code for the one or more previous query operations, adaptor code configured to recompose a plurality of rows of data output by the one or more previous query operations into one or more data chunks that the query operation is able to operate on.

6. The system of claim 1 , further comprising:

combining code for the query operation and code for the one or more previous query operations to at least form a continuous segment of code for the query plan.

7. A computer-implemented method, comprising:

translating, into corresponding code, a query operation in a query plan comprising a sequence of query operations;

determining a context for the translating of the query operation, the context corresponding to whether the query operation comprises a pre-compiled query operation or a code-generating query operation, the context for the translating of the query operation comprising a code generating mode when the query operation comprises a code-generating query operation;

detecting a change in context between the translating of the query operation and a translation of one or more previous query operations comprising pre-compiled query operations;

in response to detecting the change in context, inserting, between code for the query operation and code for the one or more previous query operations in the sequence of query operations, adaptor code configured to decompose a data chunk output by the one or more previous query operations into a plurality of rows of data that the query operation is able to operate on.

8. The method of claim 7 , wherein the translating of the query operation comprises triggering a dynamic generation of the corresponding code for the query operation, when the context for the translating of the query operation comprises the code generating mode.

9. The method of claim 7 , wherein the context for translating the query operation comprises a non-code generating mode, when the query operation comprises a pre-compiled query operation.

10. The method of claim 9 , wherein the translating of the query operation comprises inserting, into code for the query plan, existing code for the query operation, when the context for the translating of the query operation comprises the non-code generating mode.

11. The method of claim 9 , further comprising:

responding to the change in the context between the translating of the query operation and the translation of the one or more previous query operations comprising code-generating query operations by at least inserting, between the code for the query operation and the code for the one or more previous query operations, adaptor code configured to recompose a plurality of rows of data output by the one or more previous query operations into one or more data chunks that the query operation is able to operate on.

12. A non-transitory computer-readable storage medium including program code which when executed by at least one processor causes operations comprising:

translating, into corresponding code, a query operation in a query plan comprising a sequence of query operations;

determining a context for the translating of the query operation, the context corresponding to whether the query operation comprises a pre-compiled query operation or a code-generating query operation, the context for the translating of the query operation comprising a code generating mode when the query operation comprises a code-generating query operation;

detecting a change in context between the translating of the query operation and a translation of one or more previous query operations comprising pre-compiled query operations;

in response to detecting the change in context, inserting, between code for the query operation and code for the one or more previous query operations in the sequence of query operations, adaptor code configured to decompose a data chunk output by the one or more previous query operations into a plurality of rows of data that the query operation is able to operate on.

13. The computer-readable storage medium of claim 12 , wherein the context for translating the query operation comprises a non-code generating mode, when the query operation comprises a pre-compiled query operation.

14. The computer-readable storage medium of claim 13 , further comprising:

responding to the change in the context between the translating of the query operation and the translation of the one or more previous query operations comprising code-generating query operations by at least inserting, between the code for the query operation and the code for the one or more previous query operations, adaptor code configured to recompose a plurality of rows of data output by the one or more previous query operations into one or more data chunks that the query operation is able to operate on.

Assignments (1)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Nov 29, 2016
From: MERKER, TILL; STEPHAN, WOLFGANG; THOMAS, MORTIZ
To: SAP SE
Reel/Frame 040452/0780 →
Continuity (1)
Related Publication 20180150512A1 · May 31, 2018
Cited By (1)
US 12,229,132