You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hudi.apache.org by GitBox <gi...@apache.org> on 2022/07/06 07:30:08 UTC

[GitHub] [hudi] hechao-ustc opened a new pull request, #6053: [HUDI-3500] Add call procedure for RepairsCommand

hechao-ustc opened a new pull request, #6053:
URL: https://github.com/apache/hudi/pull/6053

   ## *Tips*
   - *Thank you very much for contributing to Apache Hudi.*
   - *Please review https://hudi.apache.org/contribute/how-to-contribute before opening a pull request.*
   
   ## What is the purpose of the pull request
   
   *(For example: This pull request adds quick-start document.)*
   
   ## Brief change log
   
   *(for example:)*
     - *Modify AnnotationLocation checkstyle rule in checkstyle.xml*
   
   ## Verify this pull request
   
   *(Please pick either of the following options)*
   
   This pull request is a trivial rework / code cleanup without any test coverage.
   
   *(or)*
   
   This pull request is already covered by existing tests, such as *(please describe tests)*.
   
   (or)
   
   This change added tests and can be verified as follows:
   
   *(example:)*
   
     - *Added integration tests for end-to-end.*
     - *Added HoodieClientWriteTest to verify the change.*
     - *Manually verified the change by running a job locally.*
   
   ## Committer checklist
   
    - [ ] Has a corresponding JIRA in PR title & commit
    
    - [ ] Commit message is descriptive of the change
    
    - [ ] CI is green
   
    - [ ] Necessary doc changes done or have another open PR
          
    - [ ] For large changes, please consider breaking it into sub-tasks under an umbrella JIRA.
   


-- 
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: commits-unsubscribe@hudi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [hudi] hudi-bot commented on pull request #6053: [HUDI-3500] Add call procedure for RepairsCommand

Posted by GitBox <gi...@apache.org>.
hudi-bot commented on PR #6053:
URL: https://github.com/apache/hudi/pull/6053#issuecomment-1176046901

   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "815dbbfb10f8c37a0027f56009bd0c2339fe0fb5",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9744",
       "triggerID" : "815dbbfb10f8c37a0027f56009bd0c2339fe0fb5",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 815dbbfb10f8c37a0027f56009bd0c2339fe0fb5 Azure: [SUCCESS](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9744) 
   
   <details>
   <summary>Bot commands</summary>
     @hudi-bot supports the following commands:
   
    - `@hudi-bot run azure` re-run the last Azure build
   </details>


-- 
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: commits-unsubscribe@hudi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [hudi] hudi-bot commented on pull request #6053: [HUDI-3500] Add call procedure for RepairsCommand

Posted by GitBox <gi...@apache.org>.
hudi-bot commented on PR #6053:
URL: https://github.com/apache/hudi/pull/6053#issuecomment-1178540693

   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "815dbbfb10f8c37a0027f56009bd0c2339fe0fb5",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9744",
       "triggerID" : "815dbbfb10f8c37a0027f56009bd0c2339fe0fb5",
       "triggerType" : "PUSH"
     }, {
       "hash" : "27bf6e953fd6657b0118f24d0768fe88d943ec34",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9765",
       "triggerID" : "27bf6e953fd6657b0118f24d0768fe88d943ec34",
       "triggerType" : "PUSH"
     }, {
       "hash" : "b7393c7fcebc53afea95fa742aea032ecd5f860a",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9773",
       "triggerID" : "b7393c7fcebc53afea95fa742aea032ecd5f860a",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * b7393c7fcebc53afea95fa742aea032ecd5f860a Azure: [FAILURE](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9773) 
   
   <details>
   <summary>Bot commands</summary>
     @hudi-bot supports the following commands:
   
    - `@hudi-bot run azure` re-run the last Azure build
   </details>


-- 
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: commits-unsubscribe@hudi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [hudi] hudi-bot commented on pull request #6053: [HUDI-3500] Add call procedure for RepairsCommand

Posted by GitBox <gi...@apache.org>.
hudi-bot commented on PR #6053:
URL: https://github.com/apache/hudi/pull/6053#issuecomment-1178474413

   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "815dbbfb10f8c37a0027f56009bd0c2339fe0fb5",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9744",
       "triggerID" : "815dbbfb10f8c37a0027f56009bd0c2339fe0fb5",
       "triggerType" : "PUSH"
     }, {
       "hash" : "27bf6e953fd6657b0118f24d0768fe88d943ec34",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9765",
       "triggerID" : "27bf6e953fd6657b0118f24d0768fe88d943ec34",
       "triggerType" : "PUSH"
     }, {
       "hash" : "b7393c7fcebc53afea95fa742aea032ecd5f860a",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9773",
       "triggerID" : "b7393c7fcebc53afea95fa742aea032ecd5f860a",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 27bf6e953fd6657b0118f24d0768fe88d943ec34 Azure: [FAILURE](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9765) 
   * b7393c7fcebc53afea95fa742aea032ecd5f860a Azure: [PENDING](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9773) 
   
   <details>
   <summary>Bot commands</summary>
     @hudi-bot supports the following commands:
   
    - `@hudi-bot run azure` re-run the last Azure build
   </details>


-- 
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: commits-unsubscribe@hudi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [hudi] hudi-bot commented on pull request #6053: [HUDI-3500] Add call procedure for RepairsCommand

Posted by GitBox <gi...@apache.org>.
hudi-bot commented on PR #6053:
URL: https://github.com/apache/hudi/pull/6053#issuecomment-1178472159

   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "815dbbfb10f8c37a0027f56009bd0c2339fe0fb5",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9744",
       "triggerID" : "815dbbfb10f8c37a0027f56009bd0c2339fe0fb5",
       "triggerType" : "PUSH"
     }, {
       "hash" : "27bf6e953fd6657b0118f24d0768fe88d943ec34",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9765",
       "triggerID" : "27bf6e953fd6657b0118f24d0768fe88d943ec34",
       "triggerType" : "PUSH"
     }, {
       "hash" : "b7393c7fcebc53afea95fa742aea032ecd5f860a",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "b7393c7fcebc53afea95fa742aea032ecd5f860a",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 27bf6e953fd6657b0118f24d0768fe88d943ec34 Azure: [FAILURE](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9765) 
   * b7393c7fcebc53afea95fa742aea032ecd5f860a UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     @hudi-bot supports the following commands:
   
    - `@hudi-bot run azure` re-run the last Azure build
   </details>


-- 
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: commits-unsubscribe@hudi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [hudi] hudi-bot commented on pull request #6053: [HUDI-3500] Add call procedure for RepairsCommand

Posted by GitBox <gi...@apache.org>.
hudi-bot commented on PR #6053:
URL: https://github.com/apache/hudi/pull/6053#issuecomment-1177802984

   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "815dbbfb10f8c37a0027f56009bd0c2339fe0fb5",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9744",
       "triggerID" : "815dbbfb10f8c37a0027f56009bd0c2339fe0fb5",
       "triggerType" : "PUSH"
     }, {
       "hash" : "27bf6e953fd6657b0118f24d0768fe88d943ec34",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9765",
       "triggerID" : "27bf6e953fd6657b0118f24d0768fe88d943ec34",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 815dbbfb10f8c37a0027f56009bd0c2339fe0fb5 Azure: [SUCCESS](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9744) 
   * 27bf6e953fd6657b0118f24d0768fe88d943ec34 Azure: [PENDING](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9765) 
   
   <details>
   <summary>Bot commands</summary>
     @hudi-bot supports the following commands:
   
    - `@hudi-bot run azure` re-run the last Azure build
   </details>


-- 
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: commits-unsubscribe@hudi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [hudi] hudi-bot commented on pull request #6053: [HUDI-3500] Add call procedure for RepairsCommand

Posted by GitBox <gi...@apache.org>.
hudi-bot commented on PR #6053:
URL: https://github.com/apache/hudi/pull/6053#issuecomment-1178679596

   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "815dbbfb10f8c37a0027f56009bd0c2339fe0fb5",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9744",
       "triggerID" : "815dbbfb10f8c37a0027f56009bd0c2339fe0fb5",
       "triggerType" : "PUSH"
     }, {
       "hash" : "27bf6e953fd6657b0118f24d0768fe88d943ec34",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9765",
       "triggerID" : "27bf6e953fd6657b0118f24d0768fe88d943ec34",
       "triggerType" : "PUSH"
     }, {
       "hash" : "b7393c7fcebc53afea95fa742aea032ecd5f860a",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9773",
       "triggerID" : "b7393c7fcebc53afea95fa742aea032ecd5f860a",
       "triggerType" : "PUSH"
     }, {
       "hash" : "2f650218bde3804e2f1b293db2c15e3bc0f73d90",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9785",
       "triggerID" : "2f650218bde3804e2f1b293db2c15e3bc0f73d90",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * b7393c7fcebc53afea95fa742aea032ecd5f860a Azure: [FAILURE](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9773) 
   * 2f650218bde3804e2f1b293db2c15e3bc0f73d90 Azure: [PENDING](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9785) 
   
   <details>
   <summary>Bot commands</summary>
     @hudi-bot supports the following commands:
   
    - `@hudi-bot run azure` re-run the last Azure build
   </details>


-- 
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: commits-unsubscribe@hudi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [hudi] hudi-bot commented on pull request #6053: [HUDI-3500] Add call procedure for RepairsCommand

Posted by GitBox <gi...@apache.org>.
hudi-bot commented on PR #6053:
URL: https://github.com/apache/hudi/pull/6053#issuecomment-1177911031

   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "815dbbfb10f8c37a0027f56009bd0c2339fe0fb5",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9744",
       "triggerID" : "815dbbfb10f8c37a0027f56009bd0c2339fe0fb5",
       "triggerType" : "PUSH"
     }, {
       "hash" : "27bf6e953fd6657b0118f24d0768fe88d943ec34",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9765",
       "triggerID" : "27bf6e953fd6657b0118f24d0768fe88d943ec34",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 27bf6e953fd6657b0118f24d0768fe88d943ec34 Azure: [FAILURE](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9765) 
   
   <details>
   <summary>Bot commands</summary>
     @hudi-bot supports the following commands:
   
    - `@hudi-bot run azure` re-run the last Azure build
   </details>


-- 
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: commits-unsubscribe@hudi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [hudi] hudi-bot commented on pull request #6053: [HUDI-3500] Add call procedure for RepairsCommand

Posted by GitBox <gi...@apache.org>.
hudi-bot commented on PR #6053:
URL: https://github.com/apache/hudi/pull/6053#issuecomment-1175926093

   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "815dbbfb10f8c37a0027f56009bd0c2339fe0fb5",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9744",
       "triggerID" : "815dbbfb10f8c37a0027f56009bd0c2339fe0fb5",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 815dbbfb10f8c37a0027f56009bd0c2339fe0fb5 Azure: [PENDING](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9744) 
   
   <details>
   <summary>Bot commands</summary>
     @hudi-bot supports the following commands:
   
    - `@hudi-bot run azure` re-run the last Azure build
   </details>


-- 
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: commits-unsubscribe@hudi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [hudi] xiarixiaoyao commented on a diff in pull request #6053: [HUDI-3500] Add call procedure for RepairsCommand

Posted by GitBox <gi...@apache.org>.
xiarixiaoyao commented on code in PR #6053:
URL: https://github.com/apache/hudi/pull/6053#discussion_r915932232


##########
hudi-spark-datasource/hudi-spark/src/main/scala/org/apache/spark/sql/hudi/DedupeSparkJob.scala:
##########
@@ -0,0 +1,248 @@
+/*
+ * 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.spark.sql.hudi
+
+import org.apache.hadoop.fs.{FileSystem, FileUtil, Path}
+import org.apache.hudi.common.fs.FSUtils
+import org.apache.hudi.common.model.{HoodieBaseFile, HoodieRecord}
+import org.apache.hudi.common.table.HoodieTableMetaClient
+import org.apache.hudi.common.table.view.HoodieTableFileSystemView
+import org.apache.hudi.exception.HoodieException
+import org.apache.log4j.Logger
+import org.apache.spark.sql.{DataFrame, Row, SQLContext}
+
+import java.util.stream.Collectors
+import scala.collection.JavaConversions._
+import scala.collection.mutable.{Buffer, HashMap, HashSet, ListBuffer}
+
+/**
+  * Spark job to de-duplicate data present in a partition path
+  */
+class DedupeSparkJob(basePath: String,
+                     duplicatedPartitionPath: String,
+                     repairOutputPath: String,
+                     sqlContext: SQLContext,
+                     fs: FileSystem,
+                     dedupeType: DeDupeType.Value) {
+
+  val sparkHelper = new SparkHelper(sqlContext, fs)
+  val LOG = Logger.getLogger(this.getClass)
+
+
+  /**
+    *
+    * @param tblName
+    * @return
+    */
+  def getDupeKeyDF(tblName: String): DataFrame = {
+    val dupeSql =
+      s"""
+      select  `${HoodieRecord.RECORD_KEY_METADATA_FIELD}` as dupe_key,
+      count(*) as dupe_cnt
+      from ${tblName}
+      group by `${HoodieRecord.RECORD_KEY_METADATA_FIELD}`
+      having dupe_cnt > 1
+      """
+    sqlContext.sql(dupeSql)
+  }
+

Review Comment:
   Delete blank lines



-- 
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: commits-unsubscribe@hudi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [hudi] hechao-ustc commented on a diff in pull request #6053: [HUDI-3500] Add call procedure for RepairsCommand

Posted by GitBox <gi...@apache.org>.
hechao-ustc commented on code in PR #6053:
URL: https://github.com/apache/hudi/pull/6053#discussion_r915959343


##########
hudi-spark-datasource/hudi-spark/src/main/scala/org/apache/spark/sql/hudi/DedupeSparkJob.scala:
##########
@@ -0,0 +1,248 @@
+/*
+ * 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.spark.sql.hudi
+
+import org.apache.hadoop.fs.{FileSystem, FileUtil, Path}
+import org.apache.hudi.common.fs.FSUtils
+import org.apache.hudi.common.model.{HoodieBaseFile, HoodieRecord}
+import org.apache.hudi.common.table.HoodieTableMetaClient
+import org.apache.hudi.common.table.view.HoodieTableFileSystemView
+import org.apache.hudi.exception.HoodieException
+import org.apache.log4j.Logger
+import org.apache.spark.sql.{DataFrame, Row, SQLContext}
+
+import java.util.stream.Collectors
+import scala.collection.JavaConversions._
+import scala.collection.mutable.{Buffer, HashMap, HashSet, ListBuffer}
+
+/**
+  * Spark job to de-duplicate data present in a partition path
+  */
+class DedupeSparkJob(basePath: String,
+                     duplicatedPartitionPath: String,
+                     repairOutputPath: String,
+                     sqlContext: SQLContext,
+                     fs: FileSystem,
+                     dedupeType: DeDupeType.Value) {
+
+  val sparkHelper = new SparkHelper(sqlContext, fs)
+  val LOG = Logger.getLogger(this.getClass)
+
+
+  /**
+    *
+    * @param tblName
+    * @return
+    */
+  def getDupeKeyDF(tblName: String): DataFrame = {
+    val dupeSql =
+      s"""
+      select  `${HoodieRecord.RECORD_KEY_METADATA_FIELD}` as dupe_key,
+      count(*) as dupe_cnt
+      from ${tblName}
+      group by `${HoodieRecord.RECORD_KEY_METADATA_FIELD}`
+      having dupe_cnt > 1
+      """
+    sqlContext.sql(dupeSql)
+  }
+

Review Comment:
   Done



-- 
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: commits-unsubscribe@hudi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [hudi] hudi-bot commented on pull request #6053: [HUDI-3500] Add call procedure for RepairsCommand

Posted by GitBox <gi...@apache.org>.
hudi-bot commented on PR #6053:
URL: https://github.com/apache/hudi/pull/6053#issuecomment-1177734844

   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "815dbbfb10f8c37a0027f56009bd0c2339fe0fb5",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9744",
       "triggerID" : "815dbbfb10f8c37a0027f56009bd0c2339fe0fb5",
       "triggerType" : "PUSH"
     }, {
       "hash" : "27bf6e953fd6657b0118f24d0768fe88d943ec34",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "27bf6e953fd6657b0118f24d0768fe88d943ec34",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 815dbbfb10f8c37a0027f56009bd0c2339fe0fb5 Azure: [SUCCESS](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9744) 
   * 27bf6e953fd6657b0118f24d0768fe88d943ec34 UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     @hudi-bot supports the following commands:
   
    - `@hudi-bot run azure` re-run the last Azure build
   </details>


-- 
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: commits-unsubscribe@hudi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [hudi] hudi-bot commented on pull request #6053: [HUDI-3500] Add call procedure for RepairsCommand

Posted by GitBox <gi...@apache.org>.
hudi-bot commented on PR #6053:
URL: https://github.com/apache/hudi/pull/6053#issuecomment-1175921850

   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "815dbbfb10f8c37a0027f56009bd0c2339fe0fb5",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "815dbbfb10f8c37a0027f56009bd0c2339fe0fb5",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 815dbbfb10f8c37a0027f56009bd0c2339fe0fb5 UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     @hudi-bot supports the following commands:
   
    - `@hudi-bot run azure` re-run the last Azure build
   </details>


-- 
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: commits-unsubscribe@hudi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [hudi] hudi-bot commented on pull request #6053: [HUDI-3500] Add call procedure for RepairsCommand

Posted by GitBox <gi...@apache.org>.
hudi-bot commented on PR #6053:
URL: https://github.com/apache/hudi/pull/6053#issuecomment-1178675483

   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "815dbbfb10f8c37a0027f56009bd0c2339fe0fb5",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9744",
       "triggerID" : "815dbbfb10f8c37a0027f56009bd0c2339fe0fb5",
       "triggerType" : "PUSH"
     }, {
       "hash" : "27bf6e953fd6657b0118f24d0768fe88d943ec34",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9765",
       "triggerID" : "27bf6e953fd6657b0118f24d0768fe88d943ec34",
       "triggerType" : "PUSH"
     }, {
       "hash" : "b7393c7fcebc53afea95fa742aea032ecd5f860a",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9773",
       "triggerID" : "b7393c7fcebc53afea95fa742aea032ecd5f860a",
       "triggerType" : "PUSH"
     }, {
       "hash" : "2f650218bde3804e2f1b293db2c15e3bc0f73d90",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "2f650218bde3804e2f1b293db2c15e3bc0f73d90",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * b7393c7fcebc53afea95fa742aea032ecd5f860a Azure: [FAILURE](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9773) 
   * 2f650218bde3804e2f1b293db2c15e3bc0f73d90 UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     @hudi-bot supports the following commands:
   
    - `@hudi-bot run azure` re-run the last Azure build
   </details>


-- 
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: commits-unsubscribe@hudi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [hudi] XuQianJin-Stars merged pull request #6053: [HUDI-3500] Add call procedure for RepairsCommand

Posted by GitBox <gi...@apache.org>.
XuQianJin-Stars merged PR #6053:
URL: https://github.com/apache/hudi/pull/6053


-- 
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: commits-unsubscribe@hudi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [hudi] hudi-bot commented on pull request #6053: [HUDI-3500] Add call procedure for RepairsCommand

Posted by GitBox <gi...@apache.org>.
hudi-bot commented on PR #6053:
URL: https://github.com/apache/hudi/pull/6053#issuecomment-1179049828

   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "815dbbfb10f8c37a0027f56009bd0c2339fe0fb5",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9744",
       "triggerID" : "815dbbfb10f8c37a0027f56009bd0c2339fe0fb5",
       "triggerType" : "PUSH"
     }, {
       "hash" : "27bf6e953fd6657b0118f24d0768fe88d943ec34",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9765",
       "triggerID" : "27bf6e953fd6657b0118f24d0768fe88d943ec34",
       "triggerType" : "PUSH"
     }, {
       "hash" : "b7393c7fcebc53afea95fa742aea032ecd5f860a",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9773",
       "triggerID" : "b7393c7fcebc53afea95fa742aea032ecd5f860a",
       "triggerType" : "PUSH"
     }, {
       "hash" : "2f650218bde3804e2f1b293db2c15e3bc0f73d90",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9785",
       "triggerID" : "2f650218bde3804e2f1b293db2c15e3bc0f73d90",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 2f650218bde3804e2f1b293db2c15e3bc0f73d90 Azure: [SUCCESS](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9785) 
   
   <details>
   <summary>Bot commands</summary>
     @hudi-bot supports the following commands:
   
    - `@hudi-bot run azure` re-run the last Azure build
   </details>


-- 
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: commits-unsubscribe@hudi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org