[ 
https://issues.apache.org/jira/browse/HIVE-21197?focusedWorklogId=204094&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-204094
 ]

ASF GitHub Bot logged work on HIVE-21197:
-----------------------------------------

                Author: ASF GitHub Bot
            Created on: 26/Feb/19 05:36
            Start Date: 26/Feb/19 05:36
    Worklog Time Spent: 10m 
      Work Description: sankarh commented on pull request #541: HIVE-21197 : 
Hive Replication can add duplicate data during migration to a target with 
hive.strict.managed.tables enabled
URL: https://github.com/apache/hive/pull/541#discussion_r260131280
 
 

 ##########
 File path: 
ql/src/java/org/apache/hadoop/hive/ql/plan/ReplSetFirstIncLoadFlagDesc.java
 ##########
 @@ -0,0 +1,71 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.hadoop.hive.ql.plan;
+import org.apache.hadoop.hive.ql.plan.Explain.Level;
+
+import java.io.Serializable;
+
+/**
+ * ReplSetFirstIncLoadFlagDesc.
+ *
+ */
+@Explain(displayName = "Set First Incr Load Flag", explainLevels = { 
Level.USER, Level.DEFAULT, Level.EXTENDED })
+public class ReplSetFirstIncLoadFlagDesc extends DDLDesc implements 
Serializable {
+
+  private static final long serialVersionUID = 1L;
+  String databaseName;
+  String tableName;
+  boolean incLoadPendingFlag;
+
+  /**
+   * For serialization only.
+   */
+  public ReplSetFirstIncLoadFlagDesc() {
+  }
+
+  public ReplSetFirstIncLoadFlagDesc(String databaseName, String tableName, 
boolean incLoadPendingFlag) {
+    super();
+    this.databaseName = databaseName;
+    this.tableName = tableName;
+    this.incLoadPendingFlag = incLoadPendingFlag;
+  }
+
+  @Explain(displayName="db_name", explainLevels = { Level.USER, Level.DEFAULT, 
Level.EXTENDED })
+  public String getDatabaseName() {
+    return databaseName;
+  }
+
+  public void setDatabaseName(String databaseName) {
+    this.databaseName = databaseName;
+  }
+
+  @Explain(displayName="table_name", explainLevels = { Level.USER, 
Level.DEFAULT, Level.EXTENDED })
+  public String getTableName() {
+    return tableName;
+  }
+
+  public void setTableName(String tableName) {
+    this.tableName = tableName;
+  }
+
+  @Explain(displayName="inc load pending flag", explainLevels = { Level.USER, 
Level.DEFAULT, Level.EXTENDED })
 
 Review comment:
   OK
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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


Issue Time Tracking
-------------------

    Worklog Id:     (was: 204094)
    Time Spent: 21.5h  (was: 21h 20m)

> Hive replication can add duplicate data during migration to a target with 
> hive.strict.managed.tables enabled
> ------------------------------------------------------------------------------------------------------------
>
>                 Key: HIVE-21197
>                 URL: https://issues.apache.org/jira/browse/HIVE-21197
>             Project: Hive
>          Issue Type: Task
>          Components: repl
>            Reporter: mahesh kumar behera
>            Assignee: mahesh kumar behera
>            Priority: Major
>              Labels: pull-request-available
>         Attachments: HIVE-21197.01.patch, HIVE-21197.02.patch, 
> HIVE-21197.03.patch, HIVE-21197.04.patch
>
>          Time Spent: 21.5h
>  Remaining Estimate: 0h
>
> During bootstrap phase it may happen that the files copied to target are 
> created by events which are not part of the bootstrap. This is because of the 
> fact that, bootstrap first gets the last event id and then the file list. 
> During this period if some event are added, then bootstrap will include files 
> created by these events also.The same files will be copied again during the 
> first incremental replication just after the bootstrap. In normal scenario, 
> the duplicate copy does not cause any issue as hive allows the use of target 
> database only after the first incremental. But in case of migration, the file 
> at source and target are copied to different location (based on the write id 
> at target) and thus this may lead to duplicate data at target. This can be 
> avoided by having at check at load time for duplicate file. This check can be 
> done only for the first incremental and the search can be done in the 
> bootstrap directory (with write id 1). if the file is already present then 
> just ignore the copy.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to