phoenix-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Hadoop QA (JIRA)" <>
Subject [jira] [Commented] (PHOENIX-1614) ALTER TABLE ADD IF NOT EXISTS doesn't work as expected
Date Tue, 26 Feb 2019 17:19:00 GMT


Hadoop QA commented on PHOENIX-1614:

{color:red}-1 overall{color}.  Here are the results of testing the latest attachment
  against master branch at commit 122ea979da2539308efaa78a92c4939b94e415bb.
  ATTACHMENT ID: 12960176

    {color:green}+1 @author{color}.  The patch does not contain any @author tags.

    {color:red}-1 tests included{color}.  The patch doesn't appear to include any new or modified
                        Please justify why no new tests are needed for this patch.
                        Also please list what manual steps were performed to verify this patch.

    {color:green}+1 javac{color}.  The applied patch does not increase the total number of
javac compiler warnings.

    {color:red}-1 release audit{color}.  The applied patch generated 1 release audit warnings
(more than the master's current 0 warnings).

    {color:red}-1 lineLengths{color}.  The patch introduces the following lines longer than
    +            ddl = "ALTER TABLE " + dataTableFullName + " ADD c1.col2 VARCHAR, c1.col3
integer, c2.col4 integer";
+            // If we are adding two columns but one of them already exists, the other one
should not be added
+            // If we are adding two columns with "IF NOT EXISTS" and one of them already
exists, the other one should be added
+            ddl = "ALTER TABLE " + dataTableFullName + " ADD IF NOT EXISTS col5 integer,
c1.col2 VARCHAR";
+            query = "SELECT a_string, col1, col5 FROM " + dataTableFullName + " WHERE a_string
= 'e' ";
+            verify(connectionQueryServices, notExists ? times(1) : never() ).addColumn(eq(Collections.<Mutation>emptyList()),
any(PTable.class), anyMap(), anySetOf(String.class), anyListOf(PColumn.class), false);
+                                byte[] colName = rowKeyMetaData[PhoenixDatabaseMetaData.COLUMN_NAME_INDEX];
+                                    // If the given column already exists, remove the mutation
for it from tableMetaData
+                                    return new MetaDataMutationResult(MutationCode.COLUMN_ALREADY_EXISTS,
+    public MetaDataMutationResult addColumn(List<Mutation> tableMetaData, PTable table,
Map<String, List<Pair<String,Object>>> properties, Set<String> colFamiliesForPColumnsToBeAdded,
List<PColumn> columns, boolean ifNotExists) throws SQLException;

     {color:red}-1 core tests{color}.  The patch failed these unit tests:

Test results:
Release audit warnings:
Console output:

This message is automatically generated.

> ALTER TABLE ADD IF NOT EXISTS doesn't work as expected
> ------------------------------------------------------
>                 Key: PHOENIX-1614
>                 URL:
>             Project: Phoenix
>          Issue Type: Bug
>            Reporter: Gabriel Reid
>            Assignee: Toshihiro Suzuki
>            Priority: Major
>              Labels: argus
>             Fix For: 4.15.0
>         Attachments: PHOENIX-1614.patch
> On an existing table table, executing "ALTER TABLE ADD IF NOT EXISTS
> thisColAlreadyExists varchar, thisColDoesNotExist varchar", then
> nothing will be changed in the table because thisColAlreadyExists
> already exists.
> Omitting the already-existing column from the statement, all new columns
> do get created.
> The general expectation would be that when you use ADD IF NOT EXISTS, all
> non-existent columns will be added, and all existing columns in the
> statement will just be ignored. There is already an integration test
> (AlterTableIT#testAddVarCols) that actually demonstrates the current
> behavior, although this is probably not correct.
> As pointed out in the related mailing list thread [1], ALTER TABLE DROP COLUMN likely
suffers from the same issue.
> 1. 

This message was sent by Atlassian JIRA

View raw message