Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Named parameters support#200

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Conversation

@mattdeekay
Copy link
Contributor

Supports server-side named query parameterization. Client will need to call execute like this:

cursor.execute('SELECT :param_a FROM samples', {"param_a": "some_value"})

This removes client-side query injection that was a facade for query parameterization while the server-side support was still under development.

Signed-off-by: Matthew Kim <11141331+mattdeekay@users.noreply.github.com>
Signed-off-by: Matthew Kim <11141331+mattdeekay@users.noreply.github.com>
Signed-off-by: Matthew Kim <11141331+mattdeekay@users.noreply.github.com>
Signed-off-by: Matthew Kim <11141331+mattdeekay@users.noreply.github.com>
Signed-off-by: Matthew Kim <11141331+mattdeekay@users.noreply.github.com>
Signed-off-by: Matthew Kim <11141331+mattdeekay@users.noreply.github.com>
Signed-off-by: Matthew Kim <11141331+mattdeekay@users.noreply.github.com>
Copy link
Contributor

@andrefurlan-dbandrefurlan-db left a comment

Choose a reason for hiding this comment

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

please make sure that parameterized query support is consistent across all drivers/connectors.@rcypher-databricks needs to review and make sure it is. Specially data type handling stuff

)

defexecute(
self,operation:str,parameters:Optional[Dict[str,str]]=None

Choose a reason for hiding this comment

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

If we allowed users to do this I think we should continue to support it, but instead of injecting the parameter values in the driver we should convert to the format expected by the backend and pass it on.

returnspark_params

@staticmethod
defget_type_and_value(value:Any)-> (str,TSparkParameterValue):

Choose a reason for hiding this comment

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

We need to have more comprehensive handling of types. There needs to be a way for a user to specify the desired sql type of the parameter value.

@susodapop
Copy link
Contributor

Closing as this was implemented in#217

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

Reviewers

@andrefurlan-dbandrefurlan-dbandrefurlan-db left review comments

@rcypher-databricksrcypher-databricksrcypher-databricks left review comments

@susodapopsusodapopAwaiting requested review from susodapop

@arikfrarikfrAwaiting requested review from arikfr

@yunbodeng-dbyunbodeng-dbAwaiting requested review from yunbodeng-dbyunbodeng-db is a code owner

Assignees

@mattdeekaymattdeekay

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

4 participants

@mattdeekay@susodapop@andrefurlan-db@rcypher-databricks

[8]ページ先頭

©2009-2025 Movatter.jp