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



##########
File path: 
phoenix-core/src/main/java/org/apache/phoenix/schema/MetaDataClient.java
##########
@@ -3048,7 +3048,13 @@ public boolean isViewReferenced() {
              * the counter as NULL_COUNTER for extra safety.
              */
             EncodedCQCounter cqCounterToBe = tableType == PTableType.VIEW ? 
NULL_COUNTER : cqCounter;
-            PTable table = new PTableImpl.Builder()
+            PTable table;
+            //better to use the table sent back from the server so we get an 
accurate DDL
+            // timestamp, which is server-generated.
+            if (result.getTable() != null ) {

Review comment:
       This seems risky since we are relying on the fact that the PTable 
returned from the server has all the necessary attributes set as the PTable we 
create on the client-side. There are some that we set explicitly inside 
`MetaDataClient` which depend on the parent so I'm not sure we still have those 
set as expected.
   
   Instead, to be safe we can maybe `getDDLTimestamp()` from this returned 
PTable and set that in the builder. Better yet, we could just send the DDL 
timestamp in the server response rather than the entire PTable. We could then 
use the setter for this attribute when creating the PTable from its builder.




----------------------------------------------------------------
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:
us...@infra.apache.org


Reply via email to