Skip to content

Initial support for prepared statement #4426

@NGA-TRAN

Description

@NGA-TRAN

Is your feature request related to a problem or challenge? Please describe what you are trying to do.
In order to support Prepare statement I am thinking about adding 2 new functions. This is is preliminary thinking. If you have some idea please advice.

Function 1: Compile a SQL with question marks/parameters

  • Input: a SQL with question marks
  • Output:
    • Logical plan that understands question marks/parameter (not sure how yet)
    • List of data type of the parameters of the question marks

Example:

  • Input:
    SELECT  a, b FROM t WHERE x > ? and Y = ?;
  • Output:
    • Logical plan that understands question marks/parameter
    • [ i64, String ] where i64 and String are data types of X and Y respectively

Function 2: Run the compiled SQL with provided values of the parameters

  • Input:
    • Logical plan that understands question marks/parameter
    • List of values of the corresponding question marks
  • Output
    • Physical plan of the logical plan with all question marks replaced with the corresponding values in the list

Same example above

  • Input
    • Logical plan that understands question marks/parameter generated for SQL above
    • [ 7, "Boston" ]
  • Output:
    • Phychical plan of SELECT a, b FROM t WHERE x > 7 and Y = "Boston"

Describe the solution you'd like
TBD

Describe alternatives you've considered
TBD

Additional context

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions