[ https://issues.apache.org/jira/browse/HIVE-25656?focusedWorklogId=681374&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-681374 ]
ASF GitHub Bot logged work on HIVE-25656: ----------------------------------------- Author: ASF GitHub Bot Created on: 15/Nov/21 08:53 Start Date: 15/Nov/21 08:53 Worklog Time Spent: 10m Work Description: kasakrisz commented on a change in pull request #2756: URL: https://github.com/apache/hive/pull/2756#discussion_r749112764 ########## File path: standalone-metastore/metastore-server/src/main/resources/package.jdo ########## @@ -253,18 +253,33 @@ <field name="tblName"> <column name="TBL_NAME" length="256" jdbc-type="VARCHAR"/> </field> - <field name="tables" table="MV_TABLES_USED"> - <collection element-type="MTable"/> - <join> - <column name="MV_CREATION_METADATA_ID"/> - </join> - <element column="TBL_ID"/> + <field name="tables" mapped-by="creationMetadata" dependent-element="true"> + <collection element-type="MMVSource" dependent-element="true" /> + <foreign-key name="MV_TABLES_USED_FK1" delete-action="cascade"/> </field> <field name="txnList"> <column name="TXN_LIST" length="32672" jdbc-type="VARCHAR" allows-null="true"/> </field> </class> + <class name="MMVSource" identity-type="application" table="MV_TABLES_USED" detachable="true" objectid-class="MMVSource$PK"> + <field name="creationMetadata" primary-key="true"> + <column name="MV_CREATION_METADATA_ID"/> + </field> + <field name="table" primary-key="true"> + <column name="TBL_ID"/> + </field> Review comment: Added pk definitions to schema and upgrade sqls. ########## File path: standalone-metastore/metastore-server/src/main/sql/derby/upgrade-3.2.0-to-4.0.0.derby.sql ########## @@ -176,6 +176,10 @@ ALTER TABLE "APP"."DC_PRIVS" ADD CONSTRAINT "DC_PRIVS_PK" PRIMARY KEY ("DC_GRANT ALTER TABLE "APP"."DC_PRIVS" ADD CONSTRAINT "DC_PRIVS_FK1" FOREIGN KEY ("NAME") REFERENCES "APP"."DATACONNECTORS" ("NAME") ON DELETE NO ACTION ON UPDATE NO ACTION; CREATE UNIQUE INDEX "APP"."DCPRIVILEGEINDEX" ON "APP"."DC_PRIVS" ("AUTHORIZER", "NAME", "PRINCIPAL_NAME", "PRINCIPAL_TYPE", "DC_PRIV", "GRANTOR", "GRANTOR_TYPE"); +-- HIVE-25656 +ALTER TABLE "APP"."MV_TABLES_USED" ADD COLUMN "INSERTED_COUNT" BIGINT NOT NULL DEFAULT 0; +ALTER TABLE "APP"."MV_TABLES_USED" ADD COLUMN "UPDATED_COUNT" BIGINT NOT NULL DEFAULT 0; +ALTER TABLE "APP"."MV_TABLES_USED" ADD COLUMN "DELETED_COUNT" BIGINT NOT NULL DEFAULT 0; Review comment: Added pk definitions to schema and upgrade sqls. -- 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. To unsubscribe, e-mail: gitbox-unsubscr...@hive.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org Issue Time Tracking ------------------- Worklog Id: (was: 681374) Time Spent: 1h 10m (was: 1h) > Get materialized view state based on number of affected rows of transactions > ---------------------------------------------------------------------------- > > Key: HIVE-25656 > URL: https://issues.apache.org/jira/browse/HIVE-25656 > Project: Hive > Issue Type: Improvement > Components: Materialized views, Transactions > Reporter: Krisztian Kasa > Assignee: Krisztian Kasa > Priority: Major > Labels: pull-request-available > Fix For: 4.0.0 > > Time Spent: 1h 10m > Remaining Estimate: 0h > > To enable the faster incremental rebuild of materialized views presence of > update/delete operations on the source tables of the view since the last > rebuild must be checked. Based on the outcome different plan is generated for > scenarios in presence of update/delete and insert only operations. > Currently this is done by querying the COMPLETED_TXN_COMPONENTS table however > the records from this table is cleaned when MV source tables are compacted. > This reduces the chances of incremental MV rebuild. > The goal of this patch is to find an alternative way to store and retrieve > this information. -- This message was sent by Atlassian Jira (v8.20.1#820001)