Uploaded image for project: 'Calcite'
  1. Calcite
  2. CALCITE-1534

Allow compound identifiers in INSERT target column list

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 1.10.0
    • Fix Version/s: 1.11.0
    • Component/s: core
    • Labels:

      Description

      Since CALCITE-1425, the assumption of column names always being simple qualifiers in INSERT/UPDATE target column list has been removed, which means SqlValidator and Sql2RelConverter can handle compound identifiers in those places. Right now we are going to add parser support for compound identifiers.

        Activity

        Hide
        maryannxue Maryann Xue added a comment -

        Could you please take a quick look at https://github.com/apache/calcite/pull/337, Julian Hyde?

        Show
        maryannxue Maryann Xue added a comment - Could you please take a quick look at https://github.com/apache/calcite/pull/337 , Julian Hyde ?
        Hide
        julianhyde Julian Hyde added a comment - - edited
        • When creating the SqlNodeList make sure that the position
          covers the first element to the last element. Or maybe change
          SqlNodeList CompoundIdentifierCommaList() to
          void CompoundIdentifierCommaList(List<SqlNode)
          and don't worry about the position of the list as a whole.
        • Let's have a negative test inserting into a column that is not compound.
        • Let's have a negative test where c0.c1 occurs more than once.
        Show
        julianhyde Julian Hyde added a comment - - edited When creating the SqlNodeList make sure that the position covers the first element to the last element. Or maybe change SqlNodeList CompoundIdentifierCommaList() to void CompoundIdentifierCommaList(List<SqlNode) and don't worry about the position of the list as a whole. Let's have a negative test inserting into a column that is not compound. Let's have a negative test where c0.c1 occurs more than once.
        Hide
        maryannxue Maryann Xue added a comment -

        Thank you very much for the suggestions, Julian Hyde! Pushed a commit containing these suggested changes. Also, I had copied from SimpleIdentifierCommaList(), shall I apply the same change to that one as well?

        Show
        maryannxue Maryann Xue added a comment - Thank you very much for the suggestions, Julian Hyde ! Pushed a commit containing these suggested changes. Also, I had copied from SimpleIdentifierCommaList() , shall I apply the same change to that one as well?
        Hide
        julianhyde Julian Hyde added a comment -

        Yes, please fix SimpleIdentifierCommaList, and +1 to push to master.

        Show
        julianhyde Julian Hyde added a comment - Yes, please fix SimpleIdentifierCommaList, and +1 to push to master.
        Show
        maryannxue Maryann Xue added a comment - Fixed in https://git1-us-west.apache.org/repos/asf?p=calcite.git;a=commit;h=9535efb .
        Hide
        julianhyde Julian Hyde added a comment -

        Resolved in release 1.11.0 (2017-01-11).

        Show
        julianhyde Julian Hyde added a comment - Resolved in release 1.11.0 (2017-01-11).

          People

          • Assignee:
            maryannxue Maryann Xue
            Reporter:
            maryannxue Maryann Xue
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development