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

ASF GitHub Bot commented on PHOENIX-6186:
-----------------------------------------

gjacoby126 commented on a change in pull request #935:
URL: https://github.com/apache/phoenix/pull/935#discussion_r525580079



##########
File path: phoenix-core/src/main/java/org/apache/phoenix/util/ViewUtil.java
##########
@@ -654,10 +654,17 @@ public static PTable addDerivedColumnsFromParent(PTable 
view, PTable parentTable
         }
 
         long maxTableTimestamp = view.getTimeStamp();
+        long maxDDLTimestamp = view.getLastDDLTimestamp() != null ? 
view.getLastDDLTimestamp() : 0L;
         int numPKCols = view.getPKColumns().size();
-        // set the final table timestamp as the max timestamp of the view/view 
index or its
-        // ancestors
+        // set the final table timestamp and DDL timestamp as the respective 
max timestamps of the
+        // view/view index or its ancestors
         maxTableTimestamp = Math.max(maxTableTimestamp, 
parentTable.getTimeStamp());
+        //Diverged views no longer inherit ddl timestamps from their ancestors 
because they don't
+        // inherit column changes

Review comment:
       I'd be more inclined to: 
   Step 1. Update the last ddl timestamp on either add or drop column, and 
accept that in a future JIRA the schema registry will be redundantly updated in 
the (hopefully rare) event that a base table of a diverged view adds a column. 
Essentially this removes the diverged view check here in ViewUtil. (Easy)
   
   Optional Step 2. Then in a second JIRA change the diverged view logic to 
inherit changes on both add column and drop column so the updates aren't really 
redundant. (Harder, but leaves us in a better state)
   
   If there's some compelling reason to keep the existing logic, I'm interested 
to learn about it, but right now it doesn't seem to justify the enormous 
complexity (which just keeps compounding with time!) that it requires. 




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


> Store table metadata last modified timestamp in PTable / System.Catalog
> -----------------------------------------------------------------------
>
>                 Key: PHOENIX-6186
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-6186
>             Project: Phoenix
>          Issue Type: New Feature
>            Reporter: Geoffrey Jacoby
>            Assignee: Geoffrey Jacoby
>            Priority: Major
>             Fix For: 4.16.0
>
>         Attachments: PHOENIX-6186-4.x.patch
>
>
> There are many reasons why it's useful to know when a particular table's 
> metadata was last modified. It's helpful when solving cache coherency 
> problems, and also in order to interact with external schema registries which 
> may have multiple versions of a particular schema and require a timestamp to 
> resolve ambiguities. 
> This JIRA will add a last modified timestamp field to System.Catalog, to be 
> updated both when creating a table/view and also when adding or removing a 
> column. Changing purely internal Phoenix properties will not update the 
> timestamp. 



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to