[jira] [Commented] (PHOENIX-1409) Allow ALTER TABLE SET command to update HTableDescriptor and HColumnDescriptor properties

Wed, 31 Dec 2014 09:06:51 -0800

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

James Taylor commented on PHOENIX-1409:
---------------------------------------

Thanks, [~ayingshu]. Here's some feedback.

bq. 1) Thanks Samarth Jain for suggested changes in Phoenix-1409-v3.patch. 
However there is a regression on setting TTL for default column family. Fixed 
that and added a test case. 
Samarth's patch was correct. For TTL, we ensure that all column families have 
the same value. In this way, the entire row will be deleted when the TTL is up 
(which is what we want). Please revert the changes you made here and got back 
to what Samarth had.

bq. 3) Method modifyTableProps now returns the HTableDescriptor. So no need to 
get the HTableDescriptor again for setTTLForNewColumnFamilies if it is 
available.
You need to still lookup the HTableDescriptor if tableProps is empty, as 
otherwise it'll be null.
{code}
+                if (tableProps.isEmpty()) {
+                    newTableDesc = services.getTableDescriptor(tableName);
+                } else {
+                       newTableDesc = modifyTableProps(tableName, table, 
tableProps); 
+                }
{code}

bq. 4) For the new Property class, define the PropertyValidator.validate as: 
void validate(TableProperty property, boolean isMutating, PTableType tableType) 
throws SQLException;
Thinking about this more, let's just simplify it a bit more. Get rid of 
PropertyValidator and instead just add the following method to TableProperty 
enum (which can be overridden for a given enum):
{code}
// isQualified is true if column family name is specified in property name
void validate(boolean isMutating, boolean isQualified, PTableType tableType) 
throws SQLException;
{code}

bq. 5) Moved the check for not setting column family property as table property 
outside of the validate to error out sooner. 
You'll likely need to revert this change, as we're treating TTL differently - 
it's actually a column family property in HBase, but we're treating it more as 
a Phoenix table property.

Once you make these changes, if you could confirm that all unit tests are 
passing (reporting back any that aren't), that'd be much appreciated.


> Allow ALTER TABLE <table> SET command to update HTableDescriptor and 
> HColumnDescriptor properties
> -------------------------------------------------------------------------------------------------
>
>                 Key: PHOENIX-1409
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-1409
>             Project: Phoenix
>          Issue Type: Improvement
>    Affects Versions: 4.2
>            Reporter: James Taylor
>            Assignee: Alicia Ying Shu
>         Attachments: PHOENIX-1409-v3.patch, Phoenix-1409-v1.patch, 
> Phoenix-1409-v4.patch, Phoenix-1409.patch, WIP.patch, phoenix-1409-v2.patch
>
>
> Once PHOENIX-1408 is fixed, we should allow HTableDescriptor and 
> HColumnDescriptor properties through the ALTER TABLE <table> SET command. 
> It'd just be a matter of passing these properties through the existing 
> methods, as we support this for CREATE TABLE.



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

Reply via email to