[ 
https://issues.apache.org/jira/browse/PHOENIX-2791?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Thomas D'Silva updated PHOENIX-2791:
------------------------------------
    Attachment: PHOENIX-2791-v2.patch

[~jamestaylor], thanks for the review. 

I modified the added a NamedTabledNode and PTableType parameter to the  
addColumn method which is initialized based on the statement

{code}
+    public MutationState addColumn(PTable table, List<ColumnDef> columnDefs,
+            ListMultimap<String, Pair<String, Object>> stmtProperties, boolean 
ifNotExists,
+            boolean removeTableProps, NamedTableNode namedTableNode, 
PTableType tableType)
+            throws SQLException {
{code}

{code}

+        return addColumn(table, statement.getColumnDefs(), 
statement.getProps(), statement.ifNotExists(), false, statement.getTable(), 
statement.getTableType());

{code}

and then reverted my changes

{code}
-                ColumnResolver resolver = FromCompiler.getResolver(statement, 
connection);
+                ColumnResolver resolver = 
FromCompiler.getResolver(namedTableNode, connection);
{code}

{code}
-                    seqNum = incrementTableSeqNum(table, 
statement.getTableType(), columnDefs.size(), isTransactional, 
updateCacheFrequency, isImmutableRows, disableWAL, multiTenant, storeNulls);
+                    seqNum = incrementTableSeqNum(table, tableType, 
columnDefs.size(), isTransactional, updateCacheFrequency, isImmutableRows, 
disableWAL, multiTenant, storeNulls);
{code}

I didn't remove that code I added a new method to populate the maps, so that I 
could look up the APPEND_ONLY_SCHEMA in createTable. I modified 
createTableInternal to have two additional parameters for these maps.

{code}
   private void populatePropertyMaps(ListMultimap<String,Pair<String,Object>> 
props, Map<String, Object> tableProps,
            Map<String, Object> commonFamilyProps) {
{code}

I validate that APPEND_ONLY_SCHEMA property of the view is the same as the 
parent table and set the view property based on the parent. Should I just have 
the view inherit the property from the parent and disallow setting this 
property on the view?


> Support append only schema declaration
> --------------------------------------
>
>                 Key: PHOENIX-2791
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-2791
>             Project: Phoenix
>          Issue Type: Sub-task
>            Reporter: James Taylor
>            Assignee: Thomas D'Silva
>              Labels: argus
>             Fix For: 4.8.0
>
>         Attachments: PHOENIX-2791-v2.patch, PHOENIX-2791.patch
>
>
> If we know in advance that columns will only be added to but never removed 
> from a schema, we can prevent the RPC from the client to the server when the 
> client already has all columns declared in the CREATE TABLE/VIEW IF NOT 
> EXISTS. To enable this, we can add an APPEND_ONLY_SCHEMA boolean flag to 
> SYSTEM.CATALOG. Or another potential name would be IMMUTABLE_SCHEMA to match 
> IMMUTABLE_ROWS?



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

Reply via email to