[ 
https://issues.apache.org/jira/browse/PHOENIX-5210?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16951160#comment-16951160
 ] 

Chinmay Kulkarni commented on PHOENIX-5210:
-------------------------------------------

[~brfrn169] nice find and thanks for the patch! A couple of review comments:
 * Can you add the check for _origColDefs != null_ in the if condition check 
instead of the current position? i.e. 
[here|https://github.com/apache/phoenix/blob/f431f1be1f3c17dba75adfce0873848c983af82c/phoenix-core/src/main/java/org/apache/phoenix/schema/MetaDataClient.java#L3497]
* In the new test _testAlterTableOptions_, can you please add the following 
conditions to the where clause when querying SYSTEM.CATALOG: 
{code:java}
WHERE TENANT_ID IS NULL AND TABLE_SCHEM IS NULL
{code}
This will make the test quicker since we have a range scan in place of a full 
table scan of SYSTEM.CATALOG.
* nit: In the new test, capitalize `table_name`
* Looks like the previous run had failed some test in ViewMetadataIT. Please 
resubmit a patch after addressing the above review comments


> NullPointerException when alter options of a table that is appendOnlySchema
> ---------------------------------------------------------------------------
>
>                 Key: PHOENIX-5210
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-5210
>             Project: Phoenix
>          Issue Type: Bug
>            Reporter: Toshihiro Suzuki
>            Assignee: Toshihiro Suzuki
>            Priority: Major
>         Attachments: PHOENIX-5210.master.v1.patch
>
>
> I'm facing the following NullPointerException when alter options of a table 
> that is appendOnlySchema.
> {code}
> java.lang.NullPointerException
>       at 
> org.apache.phoenix.schema.MetaDataClient.addColumn(MetaDataClient.java:3545)
>       at 
> org.apache.phoenix.schema.MetaDataClient.addColumn(MetaDataClient.java:3517)
>       at 
> org.apache.phoenix.jdbc.PhoenixStatement$ExecutableAddColumnStatement$1.execute(PhoenixStatement.java:1440)
>       at 
> org.apache.phoenix.jdbc.PhoenixStatement$2.call(PhoenixStatement.java:408)
>       at 
> org.apache.phoenix.jdbc.PhoenixStatement$2.call(PhoenixStatement.java:391)
>       at org.apache.phoenix.call.CallRunner.run(CallRunner.java:53)
>       at 
> org.apache.phoenix.jdbc.PhoenixStatement.executeMutation(PhoenixStatement.java:390)
>       at 
> org.apache.phoenix.jdbc.PhoenixStatement.executeMutation(PhoenixStatement.java:378)
>       at 
> org.apache.phoenix.jdbc.PhoenixStatement.execute(PhoenixStatement.java:1833)
>       at 
> org.apache.phoenix.end2end.AppendOnlySchemaIT.testAlterTableOptions(AppendOnlySchemaIT.java:368)
> {code}
> Steps to reproduce is as follows:
> 1. Create a table that is appendOnlySchema:
> {code}
> CREATE TABLE tbl (id INTEGER PRIMARY KEY, col INTEGER) APPEND_ONLY_SCHEMA = 
> true, UPDATE_CACHE_FREQUENCY = 1;
> {code}
> 2. Alter a option of the table:
> {code}
> ALTER TABLE tbl SET STORE_NULLS = true;
> {code}
> After step 2, we will face the NullPointerException.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to