You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@phoenix.apache.org by "James Taylor (JIRA)" <ji...@apache.org> on 2017/05/09 22:30:04 UTC

[jira] [Comment Edited] (PHOENIX-3841) Phoenix View creation failure with Primary table not found error when we use update_cache_frequency for primary table

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

James Taylor edited comment on PHOENIX-3841 at 5/9/17 10:29 PM:
----------------------------------------------------------------

Patch looks good, [~sukunaidu@gmail.com]. Did it fix the issue you were seeing? Would you mind adding a comment here, something like this?
{code}
--- a/phoenix-core/src/main/java/org/apache/phoenix/compile/FromCompiler.java
+++ b/phoenix-core/src/main/java/org/apache/phoenix/compile/FromCompiler.java
@@ -172,7 +172,7 @@ public class FromCompiler {
         NamedTableNode tableNode = NamedTableNode.create(null, baseTable, Collections.<ColumnDef>emptyList());
         // Always use non-tenant-specific connection here
         try {
-            SingleTableColumnResolver visitor = new SingleTableColumnResolver(connection, tableNode, true);
+           // We need to always get the latest meta data for the parent table of a create view call to ensure that
+           // that we're copying the current table meta data as of when the view is created. Once we no longer
+           // copy the parent meta data, but store only the local diffs (PHOENIX-3534), we will no longer need
+           // to do this.
+            SingleTableColumnResolver visitor = new SingleTableColumnResolver(connection, tableNode, true, true);
{code}


was (Author: jamestaylor):
Patch looks good, [~sukunaidu@gmail.com]. Would you mind adding a comment here, something like this?
{code}
--- a/phoenix-core/src/main/java/org/apache/phoenix/compile/FromCompiler.java
+++ b/phoenix-core/src/main/java/org/apache/phoenix/compile/FromCompiler.java
@@ -172,7 +172,7 @@ public class FromCompiler {
         NamedTableNode tableNode = NamedTableNode.create(null, baseTable, Collections.<ColumnDef>emptyList());
         // Always use non-tenant-specific connection here
         try {
-            SingleTableColumnResolver visitor = new SingleTableColumnResolver(connection, tableNode, true);
+           // We need to always get the latest meta data for the parent table of a create view call to ensure that
+           // that we're copying the current table meta data as of when the view is created. Once we no longer
+           // copy the parent meta data, but store only the local diffs (PHOENIX-3534), we will no longer need
+           // to do this.
+            SingleTableColumnResolver visitor = new SingleTableColumnResolver(connection, tableNode, true, true);
{code}

> Phoenix View creation failure with Primary table not found error when we use update_cache_frequency for primary table
> ---------------------------------------------------------------------------------------------------------------------
>
>                 Key: PHOENIX-3841
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-3841
>             Project: Phoenix
>          Issue Type: Sub-task
>    Affects Versions: 4.10.0
>            Reporter: Maddineni Sukumar
>            Assignee: Maddineni Sukumar
>            Priority: Minor
>             Fix For: 4.11
>
>         Attachments: PHOENIX-3841.patch, PHOENIX-3841.v2.patch
>
>
> Create VIEW command failing with actual table not found error and next retry failed with VIEW already exists error..And its continuing like that(first tabelnotfound and then view already exists)..
> If I create table without UPDATE_CACHE_FREQUENCY then its working fine.
> Create table command:
> create table UpdateCacheViewTestB (k VARCHAR PRIMARY KEY, v1 VARCHAR, v2 VARCHAR) UPDATE_CACHE_FREQUENCY=100000;
> Create View command:
> CREATE VIEW my_view (v43 VARCHAR) AS SELECT * FROM UpdateCacheViewTestB WHERE v1 = 'value1’;
> sqlline Console output:
> 0: jdbc:phoenix:shared-mnds1-1-sfm.ops.sfdc.n> select * from UPDATECACHEVIEWTESTB;
> --------------------------------------------------------------------------------------------------------------------------
> K	V1	V2
> --------------------------------------------------------------------------------------------------------------------------
> 0: jdbc:phoenix:shared-mnds1-1-sfm.ops.sfdc.n> CREATE VIEW my_view (v43 VARCHAR) AS SELECT * FROM UpdateCacheViewTestB WHERE v1 = 'value1';
> Error: ERROR 1012 (42M03): Table undefined. tableName=UPDATECACHEVIEWTESTB (state=42M03,code=1012)
> 0: jdbc:phoenix:shared-mnds1-1-sfm.ops.sfdc.n> CREATE VIEW my_view (v43 VARCHAR) AS SELECT * FROM UpdateCacheViewTestB WHERE v1 = 'value1';
> Error: ERROR 1013 (42M04): Table already exists. tableName=MY_VIEW (state=42M04,code=1013)
> 0: jdbc:phoenix:shared-mnds1-1-sfm.ops.sfdc.n> CREATE VIEW my_view (v43 VARCHAR) AS SELECT * FROM UpdateCacheViewTestB WHERE v1 = 'value1';
> Error: ERROR 1012 (42M03): Table undefined. tableName=UPDATECACHEVIEWTESTB (state=42M03,code=1012)



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)