Skip to content

Add an early execution mode for prepared statements #227

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 24, 2020

Conversation

bpintea
Copy link
Collaborator

@bpintea bpintea commented Mar 18, 2020

This PR adds an early execution mode for prepared queries.

Applications generally prepare a statement, optionally reading result
set attributes - like columns count and their characteristics (types and
names) - before executing. A subset of these apps (generally the ones
following older API usage patterns) will fail the entire operation if
these column characteristics aren't available before execution.

Elasticsearch/SQL doesn't support the concept of prepared statements.
What the driver will now do if this mode is enabled (=the new default)
is to execute the query right away, in case this lacks any parameters.
In case the parameter marks are present, the early execution is disabled
for the statement (and potentially the query will fail). However, most
patterns of Elasticsearch/ODBC usage don't involve parameters and/or
repeated executions.

This change will allow more applications interop with
Elasticsearch/SQL.

This commit adds an early execution mode for prepared queries.

Applications generally prepare a statement, optionally reading result
set attributes - like columns count and their characteristics (types and
names) - before executing. A subset of these apps (generally the ones
following older API usage patterns) will fail the entire operation if
these column characteristics aren't available before execution.

Elasticsearch/SQL doesn't support the concept of prepared statements.
What the driver will now do if this mode is enabled (=the new default)
is to execute the query right away, in case this lacks any parameters.
In case the parameter marks are present, the early execution is disabled
for the statement (and potentially the query will fail). However, most
patterns of Elasticsearch/ODBC usage don't involve paramters and/or
repeated executions.

This change should allow more applications interop with
Elasticsearch/SQL.
@bpintea bpintea added >feature Applicable to PRs adding new functionality v8.0.0-alpha1 v7.7.0 labels Mar 18, 2020
@bpintea bpintea requested review from droberts195 and edsavage March 18, 2020 20:00
Copy link
Contributor

@droberts195 droberts195 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@bpintea bpintea merged commit 5a1d4be into elastic:master Mar 24, 2020
@bpintea bpintea deleted the feat/early_execution branch March 24, 2020 16:25
bpintea added a commit that referenced this pull request Mar 30, 2020
This commit adds an early execution mode for prepared queries.

Applications generally prepare a statement, optionally reading result
set attributes - like columns count and their characteristics (types and
names) - before executing. A subset of these apps (generally the ones
following older API usage patterns) will fail the entire operation if
these column characteristics aren't available before execution.

Elasticsearch/SQL doesn't support the concept of prepared statements.
What the driver will now do if this mode is enabled (=the new default)
is to execute the query right away, in case this lacks any parameters.
In case the parameter marks are present, the early execution is disabled
for the statement (and potentially the query will fail). However, most
patterns of Elasticsearch/ODBC usage don't involve paramters and/or
repeated executions.

This change should allow more applications interop with
Elasticsearch/SQL.

(cherry picked from commit 5a1d4be)
bpintea added a commit that referenced this pull request Mar 30, 2020
This commit adds an early execution mode for prepared queries.

Applications generally prepare a statement, optionally reading result
set attributes - like columns count and their characteristics (types and
names) - before executing. A subset of these apps (generally the ones
following older API usage patterns) will fail the entire operation if
these column characteristics aren't available before execution.

Elasticsearch/SQL doesn't support the concept of prepared statements.
What the driver will now do if this mode is enabled (=the new default)
is to execute the query right away, in case this lacks any parameters.
In case the parameter marks are present, the early execution is disabled
for the statement (and potentially the query will fail). However, most
patterns of Elasticsearch/ODBC usage don't involve paramters and/or
repeated executions.

This change should allow more applications interop with
Elasticsearch/SQL.

(cherry picked from commit 5a1d4be)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>feature Applicable to PRs adding new functionality v7.7.0 v7.8.0 v8.0.0-alpha1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants