Uploaded image for project: 'Phoenix'
  1. Phoenix
  2. PHOENIX-2679 Implement column family schema structure in Calcite-Phoenix
  3. PHOENIX-3357

Issue with column re-ordering in column family support for Calcite-Phoenix

    XMLWordPrintableJSON

    Details

    • Type: Sub-task
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:

      Description

      Found another issue here. Right now we re-order our columns so that columns from the same family can be grouped together and that column family can be taken as a structured type. So OrderByIT, there's a test regression in https://builds.apache.org/job/Phoenix-calcite/20/#showFailuresLink, because it has a table definition like:

      CREATE TABLE t
        (a_string varchar not null, cf1.a integer, cf1.b varchar, col1 integer, cf2.c varchar, cf2.d integer, col2 integer
        CONSTRAINT pk PRIMARY KEY (a_string))
      

      So when we implement PhoenixTable.getRowType(), the table definition is actually changed from "a_string, cf1.a, cf1.b, col1, cf2.c, cf2.d, col2" into "a_string, cf1.a, cf1.b, col1, col2 cf2.c, cf2.d". As a result "UPSERT INTO T" expects a different column order (data type order) for parameters, and we got an Exception. This happens just because the column re-ordering and has nothing to do with the changes for PHOENIX-2679 yet. UPSERT will get more complicated once we apply PHOENIX-2679 changes, which means there's more work to do for UPSERT for column family support. But regarding this problem alone, would you think it would make sense to add a check in Phoenix DDL that requires users to put column definitions from the same family together, like in this case, only allows "a_string, cf1.a, cf1.b, col1, col2 cf2.c, cf2.d", James R. Taylor?

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                maryannxue Wei Xue
                Reporter:
                maryannxue Wei Xue
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: