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 2015/07/08 03:42:04 UTC

[jira] [Comment Edited] (PHOENIX-2058) Check for existence and compatibility of columns being added in view

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

Thomas D'Silva edited comment on PHOENIX-2058 at 7/8/15 1:41 AM:
-----------------------------------------------------------------

[~jamestaylor] 

I have uploaded another patch. I have a test that tries to add a pk view column to the base table that currently fails.

If we have a table with pk B and view with pk B, V1,V2 and we add V1 to the base table, the test fails when trying to read a row from the base table that was previously written via the view. 

This happens because when it tries to read the rowkey using the table it assumes that there is no separator, even though the rowkey was written with a separator.

 If  I make the following change to the RowKeyValueAccessor constructor
the test passes, but other tests fails. Do what is the right way to handle this case?

{code}
-        this.hasSeparator = !isFixedLength && (datum != data.get(data.size()-1));
+        this.hasSeparator = !isFixedLength /*&& (datum != data.get(data.size()-1))*/;
{code}




was (Author: tdsilva):
[~jamestaylor] 

I have uploaded another patch. I have a test that tries to add a pk view column to the base table that currently fails.

If we have a table with pk B and view with pk B, V1,V2 and we add V1 to the base table, the test fails when trying to read from the base table that was previously written to the view. 

This happens because when it tries to read the rowkey using the table it assumes that there is no separator, even though the rowkey was written with a separator.

 If  I make the following change to the RowKeyValueAccessor constructor
the test passes, but other tests fails. Do what is the right way to handle this case?

{code}
-        this.hasSeparator = !isFixedLength && (datum != data.get(data.size()-1));
+        this.hasSeparator = !isFixedLength /*&& (datum != data.get(data.size()-1))*/;
{code}



> Check for existence and compatibility of columns being added in view
> --------------------------------------------------------------------
>
>                 Key: PHOENIX-2058
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-2058
>             Project: Phoenix
>          Issue Type: Bug
>            Reporter: James Taylor
>            Assignee: Thomas D'Silva
>         Attachments: PHOENIX-2058-WIP.patch, PHOENIX-2058.patch, PHOENIX-2058.wip.2.patch
>
>
> One check I realized we're not doing, but need to do, is ensuring that the column being added by the base table doesn't already exist in the view. If the column does already exist, ideally we can allow the addition to the base table if the type matches and the scale is null or >= existing scale and the maxLength is null or >= existing maxLength. Also, if a column is a PK column and it already exists in the view, the position in the PK must match. 
> The fact that we've materialized a PTable for the view should make the addition of this check easier.



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