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

Allow substitution variables in SQL scripts

    XMLWordPrintableJSON

Details

    • Wish
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 1.5.0
    • None
    • SQL Parser

    Description

      It would be great if substitution variables could be created à la SQL*Plus in scripts. This would be especially helpful when objects need to be (re-)created from scratch (i.e. in testing), and they share e.g. workspaces, which have to be hard-coded otherwise.

      The following is a rough idea (based on SQL*Plus syntax):

      IN_LOCATION=hdfs.project
      OUT_LOCATION=hdfs.storage
      
      CREATE VIEW &OUT_LOCATION.view_name AS
      SELECT * FROM &IN_LOCATION.table_name;
      

      For a first implementation, it would be best to have simply substitution variables and not allow computations to be done, although it is conceivable that that would be a second step.

      Attachments

        Activity

          People

            Unassigned Unassigned
            hellstorm Ian Hellstrom
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated: