Uploaded image for project: 'Apache AsterixDB'
  1. Apache AsterixDB
  2. ASTERIXDB-2401

Support parameterized queries

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • None
    • SQL - Translator SQL++
    • None

    Description

      We need to support external statement parameters in SQL++. They can be of three kinds:
      1) Named parameters, referred as: $name

      2) Positional parameters, referred as: $n where n is an integer, >= 1

      3) Positional parameters, referred as ?, which are treated as $1, ... $n in the order in which they appear in the statement.

      Parameters should be assignable through the statement execution API (/query/service). 

      For each named parameter there should be a request parameter "$name" which contains the parameter's JSON value.

      Positional parameters are passed in "args" request parameter which should be a JSON array containing parameter values.

      Statement parameters should be inlined at query compilation time, so they do not impact query optimization.

      It's an error if a statement parameter is referred by a query but its value is not provided in the API request.

      Attachments

        Activity

          People

            dlychagin-cb Dmitry Lychagin
            dlychagin-cb Dmitry Lychagin
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: