[
https://issues.apache.org/jira/browse/PHOENIX-6186?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17230067#comment-17230067
]
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_r521480773
##########
File path:
phoenix-core/src/main/java/org/apache/phoenix/coprocessor/AddColumnMutator.java
##########
@@ -399,6 +401,19 @@ public MetaDataMutationResult
validateAndAddMetadata(PTable table, byte[][] rowK
rowKeyMetaData[TABLE_NAME_INDEX])));
}
}
+ if (isAddingColumns) {
+ //We're changing the application-facing schema by adding a column,
so update the DDL
+ // timestamp
+ long serverTimestamp = EnvironmentEdgeManager.currentTimeMillis();
+
additionalTableMetadataMutations.add(MetaDataUtil.getLastDDLTimestampUpdate(tableHeaderRowKey,
+ clientTimeStamp, serverTimestamp));
+ for (PTable viewTable : childViews) {
Review comment:
@ChinmaySKulkarni - I see how inheritance logic could work for PTables,
but how would we make that work for the JDBC metadata API? (see
PhoenixDatabaseMetaData) I'm asserting throughout my tests that PTables and the
metadata API give the same answers, but the metadata API is, I believe, just
querying the table or view header row in System.Catalog.
(_Technically_, the JDBC metadata API is the "public" one and the PTables
API is the "private" one, though in all the external Phoenix-based applications
I work with for my day job, I've switched to using PTables because the JDBC
metadata API is just too inefficient since it never caches results.)
Also just want to note that in a follow-up JIRA to this, we're going to need
to (optionally) call to an external schema registry when we create a table/view
or add/remove a column from a table/view, and that _will_ need to be
synchronous, because the schema needs to be in the schema registry before DML
using that schema starts being processed by the replication pipeline.
----------------------------------------------------------------
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)