You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@phoenix.apache.org by "Thomas D'Silva (JIRA)" <ji...@apache.org> on 2016/05/10 01:59:12 UTC
[jira] [Comment Edited] (PHOENIX-2791) Support append only schema
declaration
[ https://issues.apache.org/jira/browse/PHOENIX-2791?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15277462#comment-15277462 ]
Thomas D'Silva edited comment on PHOENIX-2791 at 5/10/16 1:58 AM:
------------------------------------------------------------------
[~jamestaylor], thanks for the review.
I 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?
was (Author: tdsilva):
[~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)