Uploaded image for project: 'Apache Drill'
  1. Apache Drill
  2. DRILL-8393

Allow parameters to be passed to headers through SQL in WHERE clause

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.20.0
    • 1.22.0
    • Storage - HTTP
    • None

    Description

      Some APIs require parameters (e.g. digital signature) in the headers to be generated at access time.So I'm wondering if we can pass it in through filter statement.

      Perhaps we could design it like the params field in connections parameter. For example:
       
      Config:

      { "url": "https://api.sunrise-sunset.org/json", "requireTail": false, "params": ["body.lat", "body.lng", "body.date", "header.header1"], "parameterLocation": "json_body" }

       
      SQL Query:
      SELECT * FROM api.sunrise

      WHERE `body.lat` = 36.7201600

      AND `body.lng` = -4.4203400

      AND `body.date` = '2019-10-02'

      AND `header.header1` = 'value1';
       
      Post body:

      { "lat": 36.7201600, "lng": -4.4203400, "date": "2019-10-02"}

       
      Headers:

      { "header1": "value1", ……}

      Attachments

        Activity

          People

            cgivre Charles Givre
            lycjeff Yuchen Liang
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: