You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@phoenix.apache.org by "Samarth Jain (JIRA)" <ji...@apache.org> on 2014/10/27 08:03:33 UTC

[jira] [Created] (PHOENIX-1385) Adding, dropping and adding columns fails with NPE

Samarth Jain created PHOENIX-1385:
-------------------------------------

             Summary: Adding, dropping and adding columns fails with NPE
                 Key: PHOENIX-1385
                 URL: https://issues.apache.org/jira/browse/PHOENIX-1385
             Project: Phoenix
          Issue Type: Bug
    Affects Versions: 4.1
            Reporter: Samarth Jain


{code}
@Test
    public void testAddColumnsUsingNewConnection() throws Exception {
    	Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES);
        String ddl = "CREATE TABLE T (\n"
        	    +"ID1 VARCHAR(15) NOT NULL,\n"
        	    +"ID2 VARCHAR(15) NOT NULL,\n"
        	    +"CREATED_DATE DATE,\n"
        	    +"CREATION_TIME BIGINT,\n"
        	    +"LAST_USED DATE,\n"
        	    +"CONSTRAINT PK PRIMARY KEY (ID1, ID2))";
        Connection conn1 = DriverManager.getConnection(getUrl(), props);
        conn1.createStatement().execute(ddl);
        ddl = "ALTER TABLE T ADD STRING VARCHAR, STRING_DATA_TYPES VARCHAR";
        conn1.createStatement().execute(ddl);
        ddl = "ALTER TABLE T DROP COLUMN STRING, STRING_DATA_TYPES";
        conn1.createStatement().execute(ddl);
        ddl = "ALTER TABLE T ADD STRING_ARRAY1 VARCHAR[]";
        conn1.createStatement().execute(ddl);
        conn1.close();
    }


Exception:
java.lang.NullPointerException: at index 6
	at com.google.common.collect.ImmutableList.checkElementNotNull(ImmutableList.java:311)
	at com.google.common.collect.ImmutableList.construct(ImmutableList.java:302)
	at com.google.common.collect.ImmutableList.copyOf(ImmutableList.java:278)
	at org.apache.phoenix.schema.PTableImpl.init(PTableImpl.java:338)
	at org.apache.phoenix.schema.PTableImpl.<init>(PTableImpl.java:246)
	at org.apache.phoenix.schema.PTableImpl.makePTable(PTableImpl.java:205)
	at org.apache.phoenix.schema.PMetaDataImpl.addColumn(PMetaDataImpl.java:315)
	at org.apache.phoenix.query.ConnectionQueryServicesImpl$1.mutate(ConnectionQueryServicesImpl.java:495)
	at org.apache.phoenix.query.ConnectionQueryServicesImpl.metaDataMutated(ConnectionQueryServicesImpl.java:459)
	at org.apache.phoenix.query.ConnectionQueryServicesImpl.addColumn(ConnectionQueryServicesImpl.java:491)
	at org.apache.phoenix.jdbc.PhoenixConnection.addColumn(PhoenixConnection.java:732)
	at org.apache.phoenix.schema.MetaDataClient.addColumn(MetaDataClient.java:2073)
	at org.apache.phoenix.jdbc.PhoenixStatement$ExecutableAddColumnStatement$1.execute(PhoenixStatement.java:750)
	at org.apache.phoenix.jdbc.PhoenixStatement$3.call(PhoenixStatement.java:260)
	at org.apache.phoenix.jdbc.PhoenixStatement$3.call(PhoenixStatement.java:1)
	at org.apache.phoenix.call.CallRunner.run(CallRunner.java:53)
	at org.apache.phoenix.jdbc.PhoenixStatement.executeMutation(PhoenixStatement.java:251)
	at org.apache.phoenix.jdbc.PhoenixStatement.execute(PhoenixStatement.java:1037)
	at org.apache.phoenix.end2end.AlterTableIT.testAddColumnsUsingNewConnection(AlterTableIT.java:913)

{code}





--
This message was sent by Atlassian JIRA
(v6.3.4#6332)