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 2020/11/11 01:58:42 UTC

[GitHub] [hudi] liujinhui1994 opened a new pull request #2242: [HUDI-1366] Make deltasteamer support exporting data from hdfs to hudi

liujinhui1994 opened a new pull request #2242:
URL: https://github.com/apache/hudi/pull/2242


   Abstract DFSPathSelector
   
   ## *Tips*
   - *Thank you very much for contributing to Apache Hudi.*
   - *Please review https://hudi.apache.org/contributing.html before opening a pull request.*
   
   ## What is the purpose of the pull request
   Make deltasteamer support exporting data from hdfs to hudi.
   Currently deltastreamer does not support overwrite to read data from DFSSource, this PR will support this
   
   ## 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.

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



[GitHub] [hudi] garyli1019 commented on a change in pull request #2242: [HUDI-1366] Make deltasteamer support exporting data from hdfs to hudi

Posted by GitBox <gi...@apache.org>.
garyli1019 commented on a change in pull request #2242:
URL: https://github.com/apache/hudi/pull/2242#discussion_r527715568



##########
File path: hudi-utilities/src/main/java/org/apache/hudi/utilities/deltastreamer/HoodieDeltaStreamer.java
##########
@@ -546,6 +551,9 @@ public DeltaSyncService(Config cfg, JavaSparkContext jssc, FileSystem fs, Config
         cfg.baseFileFormat = meta.getTableConfig().getBaseFileFormat().toString();
         this.cfg.baseFileFormat = cfg.baseFileFormat;
       } else {
+        if (fs.exists(new Path(cfg.targetBasePath))) {
+          fs.delete(new Path(cfg.targetBasePath));

Review comment:
       This API has been deprecated. This operation could fail as well. Maybe we can add some exception message here.




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



[GitHub] [hudi] codecov-io commented on pull request #2242: [HUDI-1366] Make deltasteamer support exporting data from hdfs to hudi

Posted by GitBox <gi...@apache.org>.
codecov-io commented on pull request #2242:
URL: https://github.com/apache/hudi/pull/2242#issuecomment-730253264


   # [Codecov](https://codecov.io/gh/apache/hudi/pull/2242?src=pr&el=h1) Report
   > Merging [#2242](https://codecov.io/gh/apache/hudi/pull/2242?src=pr&el=desc) (8259263) into [master](https://codecov.io/gh/apache/hudi/commit/d160abb43740e0bcdf40458c345ecd2d74e6698c?el=desc) (d160abb) will **decrease** coverage by `42.76%`.
   > The diff coverage is `0.00%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/hudi/pull/2242/graphs/tree.svg?width=650&height=150&src=pr&token=VTTXabwbs2)](https://codecov.io/gh/apache/hudi/pull/2242?src=pr&el=tree)
   
   ```diff
   @@              Coverage Diff              @@
   ##             master    #2242       +/-   ##
   =============================================
   - Coverage     53.10%   10.34%   -42.77%     
   + Complexity     2705       48     -2657     
   =============================================
     Files           346       53      -293     
     Lines         15922     1789    -14133     
     Branches       1633      214     -1419     
   =============================================
   - Hits           8456      185     -8271     
   + Misses         6772     1591     -5181     
   + Partials        694       13      -681     
   ```
   
   | Flag | Coverage Δ | Complexity Δ | |
   |---|---|---|---|
   | hudicli | `?` | `?` | |
   | hudiclient | `100.00% <ø> (ø)` | `0.00 <ø> (ø)` | |
   | hudicommon | `?` | `?` | |
   | hudihadoopmr | `?` | `?` | |
   | hudispark | `?` | `?` | |
   | huditimelineservice | `?` | `?` | |
   | hudiutilities | `10.34% <0.00%> (-59.03%)` | `0.00 <0.00> (ø)` | |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/hudi/pull/2242?src=pr&el=tree) | Coverage Δ | Complexity Δ | |
   |---|---|---|---|
   | [...in/java/org/apache/hudi/utilities/UtilHelpers.java](https://codecov.io/gh/apache/hudi/pull/2242/diff?src=pr&el=tree#diff-aHVkaS11dGlsaXRpZXMvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2h1ZGkvdXRpbGl0aWVzL1V0aWxIZWxwZXJzLmphdmE=) | `34.70% <0.00%> (-29.50%)` | `11.00 <0.00> (-19.00)` | |
   | [...di/utilities/config/HoodieDeltaStreamerConfig.java](https://codecov.io/gh/apache/hudi/pull/2242/diff?src=pr&el=tree#diff-aHVkaS11dGlsaXRpZXMvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2h1ZGkvdXRpbGl0aWVzL2NvbmZpZy9Ib29kaWVEZWx0YVN0cmVhbWVyQ29uZmlnLmphdmE=) | `0.00% <0.00%> (ø)` | `0.00 <0.00> (?)` | |
   | [...apache/hudi/utilities/deltastreamer/DeltaSync.java](https://codecov.io/gh/apache/hudi/pull/2242/diff?src=pr&el=tree#diff-aHVkaS11dGlsaXRpZXMvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2h1ZGkvdXRpbGl0aWVzL2RlbHRhc3RyZWFtZXIvRGVsdGFTeW5jLmphdmE=) | `0.00% <ø> (-70.55%)` | `0.00 <0.00> (-49.00)` | |
   | [...i/utilities/deltastreamer/HoodieDeltaStreamer.java](https://codecov.io/gh/apache/hudi/pull/2242/diff?src=pr&el=tree#diff-aHVkaS11dGlsaXRpZXMvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2h1ZGkvdXRpbGl0aWVzL2RlbHRhc3RyZWFtZXIvSG9vZGllRGVsdGFTdHJlYW1lci5qYXZh) | `0.00% <0.00%> (-69.24%)` | `0.00 <0.00> (-18.00)` | |
   | [...g/apache/hudi/utilities/sources/AvroDFSSource.java](https://codecov.io/gh/apache/hudi/pull/2242/diff?src=pr&el=tree#diff-aHVkaS11dGlsaXRpZXMvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2h1ZGkvdXRpbGl0aWVzL3NvdXJjZXMvQXZyb0RGU1NvdXJjZS5qYXZh) | `0.00% <0.00%> (ø)` | `0.00 <0.00> (ø)` | |
   | [...rg/apache/hudi/utilities/sources/CsvDFSSource.java](https://codecov.io/gh/apache/hudi/pull/2242/diff?src=pr&el=tree#diff-aHVkaS11dGlsaXRpZXMvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2h1ZGkvdXRpbGl0aWVzL3NvdXJjZXMvQ3N2REZTU291cmNlLmphdmE=) | `0.00% <0.00%> (-100.00%)` | `0.00 <0.00> (-10.00)` | |
   | [...g/apache/hudi/utilities/sources/JsonDFSSource.java](https://codecov.io/gh/apache/hudi/pull/2242/diff?src=pr&el=tree#diff-aHVkaS11dGlsaXRpZXMvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2h1ZGkvdXRpbGl0aWVzL3NvdXJjZXMvSnNvbkRGU1NvdXJjZS5qYXZh) | `0.00% <0.00%> (-100.00%)` | `0.00 <0.00> (-4.00)` | |
   | [...pache/hudi/utilities/sources/ParquetDFSSource.java](https://codecov.io/gh/apache/hudi/pull/2242/diff?src=pr&el=tree#diff-aHVkaS11dGlsaXRpZXMvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2h1ZGkvdXRpbGl0aWVzL3NvdXJjZXMvUGFycXVldERGU1NvdXJjZS5qYXZh) | `0.00% <0.00%> (-100.00%)` | `0.00 <0.00> (-5.00)` | |
   | [...ties/sources/selector/AbstractDFSPathSelector.java](https://codecov.io/gh/apache/hudi/pull/2242/diff?src=pr&el=tree#diff-aHVkaS11dGlsaXRpZXMvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2h1ZGkvdXRpbGl0aWVzL3NvdXJjZXMvc2VsZWN0b3IvQWJzdHJhY3RERlNQYXRoU2VsZWN0b3IuamF2YQ==) | `0.00% <0.00%> (ø)` | `0.00 <0.00> (?)` | |
   | [...di/utilities/sources/selector/DFSPathSelector.java](https://codecov.io/gh/apache/hudi/pull/2242/diff?src=pr&el=tree#diff-aHVkaS11dGlsaXRpZXMvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2h1ZGkvdXRpbGl0aWVzL3NvdXJjZXMvc2VsZWN0b3IvREZTUGF0aFNlbGVjdG9yLmphdmE=) | `0.00% <0.00%> (ø)` | `0.00 <0.00> (?)` | |
   | ... and [337 more](https://codecov.io/gh/apache/hudi/pull/2242/diff?src=pr&el=tree-more) | |
   


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



[GitHub] [hudi] codecov-io edited a comment on pull request #2242: [HUDI-1366] Make deltasteamer support exporting data from hdfs to hudi

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #2242:
URL: https://github.com/apache/hudi/pull/2242#issuecomment-730253264


   # [Codecov](https://codecov.io/gh/apache/hudi/pull/2242?src=pr&el=h1) Report
   > Merging [#2242](https://codecov.io/gh/apache/hudi/pull/2242?src=pr&el=desc) (043c85c) into [master](https://codecov.io/gh/apache/hudi/commit/d160abb43740e0bcdf40458c345ecd2d74e6698c?el=desc) (d160abb) will **decrease** coverage by `42.77%`.
   > The diff coverage is `0.00%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/hudi/pull/2242/graphs/tree.svg?width=650&height=150&src=pr&token=VTTXabwbs2)](https://codecov.io/gh/apache/hudi/pull/2242?src=pr&el=tree)
   
   ```diff
   @@              Coverage Diff              @@
   ##             master    #2242       +/-   ##
   =============================================
   - Coverage     53.10%   10.33%   -42.78%     
   + Complexity     2705       48     -2657     
   =============================================
     Files           346       53      -293     
     Lines         15922     1790    -14132     
     Branches       1633      214     -1419     
   =============================================
   - Hits           8456      185     -8271     
   + Misses         6772     1592     -5180     
   + Partials        694       13      -681     
   ```
   
   | Flag | Coverage Δ | Complexity Δ | |
   |---|---|---|---|
   | hudicli | `?` | `?` | |
   | hudiclient | `100.00% <ø> (ø)` | `0.00 <ø> (ø)` | |
   | hudicommon | `?` | `?` | |
   | hudihadoopmr | `?` | `?` | |
   | hudispark | `?` | `?` | |
   | huditimelineservice | `?` | `?` | |
   | hudiutilities | `10.33% <0.00%> (-59.03%)` | `0.00 <0.00> (ø)` | |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/hudi/pull/2242?src=pr&el=tree) | Coverage Δ | Complexity Δ | |
   |---|---|---|---|
   | [...in/java/org/apache/hudi/utilities/UtilHelpers.java](https://codecov.io/gh/apache/hudi/pull/2242/diff?src=pr&el=tree#diff-aHVkaS11dGlsaXRpZXMvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2h1ZGkvdXRpbGl0aWVzL1V0aWxIZWxwZXJzLmphdmE=) | `34.70% <0.00%> (-29.50%)` | `11.00 <0.00> (-19.00)` | |
   | [...di/utilities/config/HoodieDeltaStreamerConfig.java](https://codecov.io/gh/apache/hudi/pull/2242/diff?src=pr&el=tree#diff-aHVkaS11dGlsaXRpZXMvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2h1ZGkvdXRpbGl0aWVzL2NvbmZpZy9Ib29kaWVEZWx0YVN0cmVhbWVyQ29uZmlnLmphdmE=) | `0.00% <0.00%> (ø)` | `0.00 <0.00> (?)` | |
   | [...apache/hudi/utilities/deltastreamer/DeltaSync.java](https://codecov.io/gh/apache/hudi/pull/2242/diff?src=pr&el=tree#diff-aHVkaS11dGlsaXRpZXMvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2h1ZGkvdXRpbGl0aWVzL2RlbHRhc3RyZWFtZXIvRGVsdGFTeW5jLmphdmE=) | `0.00% <ø> (-70.55%)` | `0.00 <0.00> (-49.00)` | |
   | [...i/utilities/deltastreamer/HoodieDeltaStreamer.java](https://codecov.io/gh/apache/hudi/pull/2242/diff?src=pr&el=tree#diff-aHVkaS11dGlsaXRpZXMvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2h1ZGkvdXRpbGl0aWVzL2RlbHRhc3RyZWFtZXIvSG9vZGllRGVsdGFTdHJlYW1lci5qYXZh) | `0.00% <0.00%> (-69.24%)` | `0.00 <0.00> (-18.00)` | |
   | [...g/apache/hudi/utilities/sources/AvroDFSSource.java](https://codecov.io/gh/apache/hudi/pull/2242/diff?src=pr&el=tree#diff-aHVkaS11dGlsaXRpZXMvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2h1ZGkvdXRpbGl0aWVzL3NvdXJjZXMvQXZyb0RGU1NvdXJjZS5qYXZh) | `0.00% <0.00%> (ø)` | `0.00 <0.00> (ø)` | |
   | [...rg/apache/hudi/utilities/sources/CsvDFSSource.java](https://codecov.io/gh/apache/hudi/pull/2242/diff?src=pr&el=tree#diff-aHVkaS11dGlsaXRpZXMvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2h1ZGkvdXRpbGl0aWVzL3NvdXJjZXMvQ3N2REZTU291cmNlLmphdmE=) | `0.00% <0.00%> (-100.00%)` | `0.00 <0.00> (-10.00)` | |
   | [...g/apache/hudi/utilities/sources/JsonDFSSource.java](https://codecov.io/gh/apache/hudi/pull/2242/diff?src=pr&el=tree#diff-aHVkaS11dGlsaXRpZXMvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2h1ZGkvdXRpbGl0aWVzL3NvdXJjZXMvSnNvbkRGU1NvdXJjZS5qYXZh) | `0.00% <0.00%> (-100.00%)` | `0.00 <0.00> (-4.00)` | |
   | [...pache/hudi/utilities/sources/ParquetDFSSource.java](https://codecov.io/gh/apache/hudi/pull/2242/diff?src=pr&el=tree#diff-aHVkaS11dGlsaXRpZXMvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2h1ZGkvdXRpbGl0aWVzL3NvdXJjZXMvUGFycXVldERGU1NvdXJjZS5qYXZh) | `0.00% <0.00%> (-100.00%)` | `0.00 <0.00> (-5.00)` | |
   | [...ties/sources/selector/AbstractDFSPathSelector.java](https://codecov.io/gh/apache/hudi/pull/2242/diff?src=pr&el=tree#diff-aHVkaS11dGlsaXRpZXMvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2h1ZGkvdXRpbGl0aWVzL3NvdXJjZXMvc2VsZWN0b3IvQWJzdHJhY3RERlNQYXRoU2VsZWN0b3IuamF2YQ==) | `0.00% <0.00%> (ø)` | `0.00 <0.00> (?)` | |
   | [...di/utilities/sources/selector/DFSPathSelector.java](https://codecov.io/gh/apache/hudi/pull/2242/diff?src=pr&el=tree#diff-aHVkaS11dGlsaXRpZXMvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2h1ZGkvdXRpbGl0aWVzL3NvdXJjZXMvc2VsZWN0b3IvREZTUGF0aFNlbGVjdG9yLmphdmE=) | `0.00% <0.00%> (ø)` | `0.00 <0.00> (?)` | |
   | ... and [337 more](https://codecov.io/gh/apache/hudi/pull/2242/diff?src=pr&el=tree-more) | |
   


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



[GitHub] [hudi] liujinhui1994 commented on pull request #2242: [HUDI-1366] Make deltasteamer support exporting data from hdfs to hudi

Posted by GitBox <gi...@apache.org>.
liujinhui1994 commented on pull request #2242:
URL: https://github.com/apache/hudi/pull/2242#issuecomment-731164267


   > @liujinhui1994 thanks for your contribution, would you please add more descriptions about this PR? I am not quite sure if I understand the purpose.
   
   please review  
   @garyli1019 


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



[GitHub] [hudi] liujinhui1994 commented on pull request #2242: [HUDI-1366] Make deltasteamer support exporting data from hdfs to hudi

Posted by GitBox <gi...@apache.org>.
liujinhui1994 commented on pull request #2242:
URL: https://github.com/apache/hudi/pull/2242#issuecomment-828163698


   @nsivabalan  I think this PR can be temporarily cancelled. If there are users who have similar needs later, I will start again


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



[GitHub] [hudi] liujinhui1994 closed pull request #2242: [HUDI-1366] Make deltasteamer support exporting data from hdfs to hudi

Posted by GitBox <gi...@apache.org>.
liujinhui1994 closed pull request #2242:
URL: https://github.com/apache/hudi/pull/2242


   


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



[GitHub] [hudi] nsivabalan commented on pull request #2242: [HUDI-1366] Make deltasteamer support exporting data from hdfs to hudi

Posted by GitBox <gi...@apache.org>.
nsivabalan commented on pull request #2242:
URL: https://github.com/apache/hudi/pull/2242#issuecomment-822459763


   @liujinhui1994 @garyli1019 : I don't see any activity for quite some time. are we still looking to get this in. if yes, a gentle reminder to @liujinhui1994  to address the feedback. 


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



[GitHub] [hudi] liujinhui1994 commented on a change in pull request #2242: [HUDI-1366] Make deltasteamer support exporting data from hdfs to hudi

Posted by GitBox <gi...@apache.org>.
liujinhui1994 commented on a change in pull request #2242:
URL: https://github.com/apache/hudi/pull/2242#discussion_r529465555



##########
File path: hudi-utilities/src/main/java/org/apache/hudi/utilities/deltastreamer/HoodieDeltaStreamer.java
##########
@@ -522,14 +523,18 @@ public static void main(String[] args) throws Exception {
      */
     private transient DeltaSync deltaSync;
 
+    private final HoodieDeltaStreamerConfig deltaStreamerConfig;
+
     public DeltaSyncService(Config cfg, JavaSparkContext jssc, FileSystem fs, Configuration conf,
                             Option<TypedProperties> properties) throws IOException {
+      this.props = properties.get();
       this.cfg = cfg;
       this.jssc = jssc;
       this.sparkSession = SparkSession.builder().config(jssc.getConf()).getOrCreate();
       this.asyncCompactService = Option.empty();
+      this.deltaStreamerConfig = new HoodieDeltaStreamerConfig(props);
 
-      if (fs.exists(new Path(cfg.targetBasePath))) {
+      if (fs.exists(new Path(cfg.targetBasePath)) && !deltaStreamerConfig.getFullOverwrite()) {

Review comment:
       The parameter itself only acts on DFSSouce




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



[GitHub] [hudi] liujinhui1994 commented on a change in pull request #2242: [HUDI-1366] Make deltasteamer support exporting data from hdfs to hudi

Posted by GitBox <gi...@apache.org>.
liujinhui1994 commented on a change in pull request #2242:
URL: https://github.com/apache/hudi/pull/2242#discussion_r529465555



##########
File path: hudi-utilities/src/main/java/org/apache/hudi/utilities/deltastreamer/HoodieDeltaStreamer.java
##########
@@ -522,14 +523,18 @@ public static void main(String[] args) throws Exception {
      */
     private transient DeltaSync deltaSync;
 
+    private final HoodieDeltaStreamerConfig deltaStreamerConfig;
+
     public DeltaSyncService(Config cfg, JavaSparkContext jssc, FileSystem fs, Configuration conf,
                             Option<TypedProperties> properties) throws IOException {
+      this.props = properties.get();
       this.cfg = cfg;
       this.jssc = jssc;
       this.sparkSession = SparkSession.builder().config(jssc.getConf()).getOrCreate();
       this.asyncCompactService = Option.empty();
+      this.deltaStreamerConfig = new HoodieDeltaStreamerConfig(props);
 
-      if (fs.exists(new Path(cfg.targetBasePath))) {
+      if (fs.exists(new Path(cfg.targetBasePath)) && !deltaStreamerConfig.getFullOverwrite()) {

Review comment:
       The parameter itself only acts on DFSSouce,so is the command-line tool appropriate?




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



[GitHub] [hudi] codecov-io edited a comment on pull request #2242: [HUDI-1366] Make deltasteamer support exporting data from hdfs to hudi

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #2242:
URL: https://github.com/apache/hudi/pull/2242#issuecomment-730253264


   # [Codecov](https://codecov.io/gh/apache/hudi/pull/2242?src=pr&el=h1) Report
   > Merging [#2242](https://codecov.io/gh/apache/hudi/pull/2242?src=pr&el=desc) (043c85c) into [master](https://codecov.io/gh/apache/hudi/commit/d160abb43740e0bcdf40458c345ecd2d74e6698c?el=desc) (d160abb) will **decrease** coverage by `6.62%`.
   > The diff coverage is `0.00%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/hudi/pull/2242/graphs/tree.svg?width=650&height=150&src=pr&token=VTTXabwbs2)](https://codecov.io/gh/apache/hudi/pull/2242?src=pr&el=tree)
   
   ```diff
   @@             Coverage Diff              @@
   ##             master    #2242      +/-   ##
   ============================================
   - Coverage     53.10%   46.48%   -6.63%     
   + Complexity     2705     2435     -270     
   ============================================
     Files           346      345       -1     
     Lines         15922    15754     -168     
     Branches       1633     1630       -3     
   ============================================
   - Hits           8456     7323    -1133     
   - Misses         6772     7859    +1087     
   + Partials        694      572     -122     
   ```
   
   | Flag | Coverage Δ | Complexity Δ | |
   |---|---|---|---|
   | hudicli | `38.37% <ø> (ø)` | `0.00 <ø> (ø)` | |
   | hudiclient | `100.00% <ø> (ø)` | `0.00 <ø> (ø)` | |
   | hudicommon | `55.30% <ø> (+0.50%)` | `0.00 <ø> (ø)` | |
   | hudihadoopmr | `32.94% <ø> (-0.12%)` | `0.00 <ø> (ø)` | |
   | hudispark | `65.58% <ø> (ø)` | `0.00 <ø> (ø)` | |
   | huditimelineservice | `?` | `?` | |
   | hudiutilities | `10.33% <0.00%> (-59.03%)` | `0.00 <0.00> (ø)` | |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/hudi/pull/2242?src=pr&el=tree) | Coverage Δ | Complexity Δ | |
   |---|---|---|---|
   | [...in/java/org/apache/hudi/utilities/UtilHelpers.java](https://codecov.io/gh/apache/hudi/pull/2242/diff?src=pr&el=tree#diff-aHVkaS11dGlsaXRpZXMvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2h1ZGkvdXRpbGl0aWVzL1V0aWxIZWxwZXJzLmphdmE=) | `34.70% <0.00%> (-29.50%)` | `11.00 <0.00> (-19.00)` | |
   | [...di/utilities/config/HoodieDeltaStreamerConfig.java](https://codecov.io/gh/apache/hudi/pull/2242/diff?src=pr&el=tree#diff-aHVkaS11dGlsaXRpZXMvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2h1ZGkvdXRpbGl0aWVzL2NvbmZpZy9Ib29kaWVEZWx0YVN0cmVhbWVyQ29uZmlnLmphdmE=) | `0.00% <0.00%> (ø)` | `0.00 <0.00> (?)` | |
   | [...apache/hudi/utilities/deltastreamer/DeltaSync.java](https://codecov.io/gh/apache/hudi/pull/2242/diff?src=pr&el=tree#diff-aHVkaS11dGlsaXRpZXMvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2h1ZGkvdXRpbGl0aWVzL2RlbHRhc3RyZWFtZXIvRGVsdGFTeW5jLmphdmE=) | `0.00% <ø> (-70.55%)` | `0.00 <0.00> (-49.00)` | |
   | [...i/utilities/deltastreamer/HoodieDeltaStreamer.java](https://codecov.io/gh/apache/hudi/pull/2242/diff?src=pr&el=tree#diff-aHVkaS11dGlsaXRpZXMvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2h1ZGkvdXRpbGl0aWVzL2RlbHRhc3RyZWFtZXIvSG9vZGllRGVsdGFTdHJlYW1lci5qYXZh) | `0.00% <0.00%> (-69.24%)` | `0.00 <0.00> (-18.00)` | |
   | [...g/apache/hudi/utilities/sources/AvroDFSSource.java](https://codecov.io/gh/apache/hudi/pull/2242/diff?src=pr&el=tree#diff-aHVkaS11dGlsaXRpZXMvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2h1ZGkvdXRpbGl0aWVzL3NvdXJjZXMvQXZyb0RGU1NvdXJjZS5qYXZh) | `0.00% <0.00%> (ø)` | `0.00 <0.00> (ø)` | |
   | [...rg/apache/hudi/utilities/sources/CsvDFSSource.java](https://codecov.io/gh/apache/hudi/pull/2242/diff?src=pr&el=tree#diff-aHVkaS11dGlsaXRpZXMvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2h1ZGkvdXRpbGl0aWVzL3NvdXJjZXMvQ3N2REZTU291cmNlLmphdmE=) | `0.00% <0.00%> (-100.00%)` | `0.00 <0.00> (-10.00)` | |
   | [...g/apache/hudi/utilities/sources/JsonDFSSource.java](https://codecov.io/gh/apache/hudi/pull/2242/diff?src=pr&el=tree#diff-aHVkaS11dGlsaXRpZXMvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2h1ZGkvdXRpbGl0aWVzL3NvdXJjZXMvSnNvbkRGU1NvdXJjZS5qYXZh) | `0.00% <0.00%> (-100.00%)` | `0.00 <0.00> (-4.00)` | |
   | [...pache/hudi/utilities/sources/ParquetDFSSource.java](https://codecov.io/gh/apache/hudi/pull/2242/diff?src=pr&el=tree#diff-aHVkaS11dGlsaXRpZXMvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2h1ZGkvdXRpbGl0aWVzL3NvdXJjZXMvUGFycXVldERGU1NvdXJjZS5qYXZh) | `0.00% <0.00%> (-100.00%)` | `0.00 <0.00> (-5.00)` | |
   | [...ties/sources/selector/AbstractDFSPathSelector.java](https://codecov.io/gh/apache/hudi/pull/2242/diff?src=pr&el=tree#diff-aHVkaS11dGlsaXRpZXMvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2h1ZGkvdXRpbGl0aWVzL3NvdXJjZXMvc2VsZWN0b3IvQWJzdHJhY3RERlNQYXRoU2VsZWN0b3IuamF2YQ==) | `0.00% <0.00%> (ø)` | `0.00 <0.00> (?)` | |
   | [...di/utilities/sources/selector/DFSPathSelector.java](https://codecov.io/gh/apache/hudi/pull/2242/diff?src=pr&el=tree#diff-aHVkaS11dGlsaXRpZXMvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2h1ZGkvdXRpbGl0aWVzL3NvdXJjZXMvc2VsZWN0b3IvREZTUGF0aFNlbGVjdG9yLmphdmE=) | `0.00% <0.00%> (ø)` | `0.00 <0.00> (?)` | |
   | ... and [71 more](https://codecov.io/gh/apache/hudi/pull/2242/diff?src=pr&el=tree-more) | |
   


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



[GitHub] [hudi] liujinhui1994 commented on a change in pull request #2242: [HUDI-1366] Make deltasteamer support exporting data from hdfs to hudi

Posted by GitBox <gi...@apache.org>.
liujinhui1994 commented on a change in pull request #2242:
URL: https://github.com/apache/hudi/pull/2242#discussion_r528440402



##########
File path: hudi-utilities/src/main/java/org/apache/hudi/utilities/sources/selector/OverwriteDFSPathSelector.java
##########
@@ -0,0 +1,37 @@
+/*
+ * 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.hudi.utilities.sources.selector;
+
+import org.apache.hadoop.conf.Configuration;
+import org.apache.hudi.common.config.TypedProperties;
+import org.apache.hudi.common.util.Option;
+import org.apache.hudi.common.util.collection.ImmutablePair;
+import org.apache.hudi.common.util.collection.Pair;
+
+public class OverwriteDFSPathSelector extends AbstractDFSPathSelector {

Review comment:
       Because full write does not need to care about checkpoint




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



[GitHub] [hudi] liujinhui1994 commented on a change in pull request #2242: [HUDI-1366] Make deltasteamer support exporting data from hdfs to hudi

Posted by GitBox <gi...@apache.org>.
liujinhui1994 commented on a change in pull request #2242:
URL: https://github.com/apache/hudi/pull/2242#discussion_r528442425



##########
File path: hudi-integ-test/src/main/java/org/apache/hudi/integ/testsuite/helpers/DFSTestSuitePathSelector.java
##########
@@ -18,39 +18,41 @@
 
 package org.apache.hudi.integ.testsuite.helpers;
 
-import java.io.FileNotFoundException;
 import java.io.IOException;
 import java.util.ArrayList;
 import java.util.Arrays;
-import java.util.Comparator;
 import java.util.List;
 import java.util.Optional;
 import java.util.stream.Collectors;
 import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.fs.FileStatus;
-import org.apache.hadoop.fs.FsStatus;
+import org.apache.hadoop.fs.FileSystem;
 import org.apache.hadoop.fs.LocatedFileStatus;
-import org.apache.hadoop.fs.Path;
 import org.apache.hadoop.fs.RemoteIterator;
+import org.apache.hadoop.fs.Path;
 import org.apache.hudi.common.config.TypedProperties;
+import org.apache.hudi.common.fs.FSUtils;
 import org.apache.hudi.common.util.Option;
 import org.apache.hudi.common.util.collection.ImmutablePair;
 import org.apache.hudi.common.util.collection.Pair;
 import org.apache.hudi.exception.HoodieIOException;
 import org.apache.hudi.integ.testsuite.HoodieTestSuiteJob;
-import org.apache.hudi.utilities.sources.helpers.DFSPathSelector;
 

Review comment:
       ok




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



[GitHub] [hudi] liujinhui1994 commented on a change in pull request #2242: [HUDI-1366] Make deltasteamer support exporting data from hdfs to hudi

Posted by GitBox <gi...@apache.org>.
liujinhui1994 commented on a change in pull request #2242:
URL: https://github.com/apache/hudi/pull/2242#discussion_r528447890



##########
File path: hudi-utilities/src/main/java/org/apache/hudi/utilities/deltastreamer/HoodieDeltaStreamer.java
##########
@@ -546,6 +551,9 @@ public DeltaSyncService(Config cfg, JavaSparkContext jssc, FileSystem fs, Config
         cfg.baseFileFormat = meta.getTableConfig().getBaseFileFormat().toString();
         this.cfg.baseFileFormat = cfg.baseFileFormat;
       } else {
+        if (fs.exists(new Path(cfg.targetBasePath))) {
+          fs.delete(new Path(cfg.targetBasePath));

Review comment:
       ok




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



[GitHub] [hudi] garyli1019 commented on pull request #2242: [HUDI-1366] Make deltasteamer support exporting data from hdfs to hudi

Posted by GitBox <gi...@apache.org>.
garyli1019 commented on pull request #2242:
URL: https://github.com/apache/hudi/pull/2242#issuecomment-730216182


   @liujinhui1994 thanks for your contribution, would you please add more descriptions about this PR? I am not quite sure if I understand the purpose.


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



[GitHub] [hudi] garyli1019 commented on a change in pull request #2242: [HUDI-1366] Make deltasteamer support exporting data from hdfs to hudi

Posted by GitBox <gi...@apache.org>.
garyli1019 commented on a change in pull request #2242:
URL: https://github.com/apache/hudi/pull/2242#discussion_r527716705



##########
File path: hudi-integ-test/src/main/java/org/apache/hudi/integ/testsuite/helpers/DFSTestSuitePathSelector.java
##########
@@ -18,39 +18,41 @@
 
 package org.apache.hudi.integ.testsuite.helpers;
 
-import java.io.FileNotFoundException;
 import java.io.IOException;
 import java.util.ArrayList;
 import java.util.Arrays;
-import java.util.Comparator;
 import java.util.List;
 import java.util.Optional;
 import java.util.stream.Collectors;
 import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.fs.FileStatus;
-import org.apache.hadoop.fs.FsStatus;
+import org.apache.hadoop.fs.FileSystem;
 import org.apache.hadoop.fs.LocatedFileStatus;
-import org.apache.hadoop.fs.Path;
 import org.apache.hadoop.fs.RemoteIterator;
+import org.apache.hadoop.fs.Path;
 import org.apache.hudi.common.config.TypedProperties;
+import org.apache.hudi.common.fs.FSUtils;
 import org.apache.hudi.common.util.Option;
 import org.apache.hudi.common.util.collection.ImmutablePair;
 import org.apache.hudi.common.util.collection.Pair;
 import org.apache.hudi.exception.HoodieIOException;
 import org.apache.hudi.integ.testsuite.HoodieTestSuiteJob;
-import org.apache.hudi.utilities.sources.helpers.DFSPathSelector;
 

Review comment:
       nit: extra space

##########
File path: hudi-utilities/src/main/java/org/apache/hudi/utilities/deltastreamer/HoodieDeltaStreamer.java
##########
@@ -522,14 +523,18 @@ public static void main(String[] args) throws Exception {
      */
     private transient DeltaSync deltaSync;
 
+    private final HoodieDeltaStreamerConfig deltaStreamerConfig;
+
     public DeltaSyncService(Config cfg, JavaSparkContext jssc, FileSystem fs, Configuration conf,
                             Option<TypedProperties> properties) throws IOException {
+      this.props = properties.get();
       this.cfg = cfg;
       this.jssc = jssc;
       this.sparkSession = SparkSession.builder().config(jssc.getConf()).getOrCreate();
       this.asyncCompactService = Option.empty();
+      this.deltaStreamerConfig = new HoodieDeltaStreamerConfig(props);
 
-      if (fs.exists(new Path(cfg.targetBasePath))) {
+      if (fs.exists(new Path(cfg.targetBasePath)) && !deltaStreamerConfig.getFullOverwrite()) {

Review comment:
       is this configurable from the delta streamer command-line tool? Looks like we don't have this option there.

##########
File path: hudi-utilities/src/main/java/org/apache/hudi/utilities/config/HoodieDeltaStreamerConfig.java
##########
@@ -0,0 +1,49 @@
+/*
+ * 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.hudi.utilities.config;
+
+import org.apache.hudi.common.config.DefaultHoodieConfig;
+import org.apache.hudi.utilities.sources.selector.DFSPathSelector;
+
+import javax.annotation.concurrent.Immutable;
+import java.util.Properties;
+
+@Immutable
+public class HoodieDeltaStreamerConfig extends DefaultHoodieConfig {
+
+  private static final long serialVersionUID = 0L;

Review comment:
       what does this do?

##########
File path: hudi-utilities/src/main/java/org/apache/hudi/utilities/sources/selector/OverwriteDFSPathSelector.java
##########
@@ -0,0 +1,37 @@
+/*
+ * 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.hudi.utilities.sources.selector;
+
+import org.apache.hadoop.conf.Configuration;
+import org.apache.hudi.common.config.TypedProperties;
+import org.apache.hudi.common.util.Option;
+import org.apache.hudi.common.util.collection.ImmutablePair;
+import org.apache.hudi.common.util.collection.Pair;
+
+public class OverwriteDFSPathSelector extends AbstractDFSPathSelector {

Review comment:
       Why do we need this? If we wanna overwrite a folder, we just delete it right?




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



[GitHub] [hudi] codecov-io edited a comment on pull request #2242: [HUDI-1366] Make deltasteamer support exporting data from hdfs to hudi

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #2242:
URL: https://github.com/apache/hudi/pull/2242#issuecomment-730253264


   # [Codecov](https://codecov.io/gh/apache/hudi/pull/2242?src=pr&el=h1) Report
   > Merging [#2242](https://codecov.io/gh/apache/hudi/pull/2242?src=pr&el=desc) (043c85c) into [master](https://codecov.io/gh/apache/hudi/commit/d160abb43740e0bcdf40458c345ecd2d74e6698c?el=desc) (d160abb) will **increase** coverage by `0.41%`.
   > The diff coverage is `71.79%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/hudi/pull/2242/graphs/tree.svg?width=650&height=150&src=pr&token=VTTXabwbs2)](https://codecov.io/gh/apache/hudi/pull/2242?src=pr&el=tree)
   
   ```diff
   @@             Coverage Diff              @@
   ##             master    #2242      +/-   ##
   ============================================
   + Coverage     53.10%   53.52%   +0.41%     
   - Complexity     2705     2775      +70     
   ============================================
     Files           346      351       +5     
     Lines         15922    16120     +198     
     Branches       1633     1646      +13     
   ============================================
   + Hits           8456     8628     +172     
   - Misses         6772     6789      +17     
   - Partials        694      703       +9     
   ```
   
   | Flag | Coverage Δ | Complexity Δ | |
   |---|---|---|---|
   | hudicli | `38.37% <ø> (ø)` | `0.00 <ø> (ø)` | |
   | hudiclient | `100.00% <ø> (ø)` | `0.00 <ø> (ø)` | |
   | hudicommon | `55.30% <ø> (+0.50%)` | `0.00 <ø> (ø)` | |
   | hudihadoopmr | `32.94% <ø> (-0.12%)` | `0.00 <ø> (ø)` | |
   | hudispark | `65.58% <ø> (ø)` | `0.00 <ø> (ø)` | |
   | huditimelineservice | `65.30% <ø> (+3.01%)` | `0.00 <ø> (ø)` | |
   | hudiutilities | `69.88% <71.79%> (+0.52%)` | `0.00 <12.00> (ø)` | |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/hudi/pull/2242?src=pr&el=tree) | Coverage Δ | Complexity Δ | |
   |---|---|---|---|
   | [...apache/hudi/utilities/deltastreamer/DeltaSync.java](https://codecov.io/gh/apache/hudi/pull/2242/diff?src=pr&el=tree#diff-aHVkaS11dGlsaXRpZXMvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2h1ZGkvdXRpbGl0aWVzL2RlbHRhc3RyZWFtZXIvRGVsdGFTeW5jLmphdmE=) | `70.54% <ø> (ø)` | `49.00 <0.00> (ø)` | |
   | [...g/apache/hudi/utilities/sources/AvroDFSSource.java](https://codecov.io/gh/apache/hudi/pull/2242/diff?src=pr&el=tree#diff-aHVkaS11dGlsaXRpZXMvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2h1ZGkvdXRpbGl0aWVzL3NvdXJjZXMvQXZyb0RGU1NvdXJjZS5qYXZh) | `0.00% <0.00%> (ø)` | `0.00 <0.00> (ø)` | |
   | [...ies/sources/selector/OverwriteDFSPathSelector.java](https://codecov.io/gh/apache/hudi/pull/2242/diff?src=pr&el=tree#diff-aHVkaS11dGlsaXRpZXMvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2h1ZGkvdXRpbGl0aWVzL3NvdXJjZXMvc2VsZWN0b3IvT3ZlcndyaXRlREZTUGF0aFNlbGVjdG9yLmphdmE=) | `0.00% <0.00%> (ø)` | `0.00 <0.00> (?)` | |
   | [...in/java/org/apache/hudi/utilities/UtilHelpers.java](https://codecov.io/gh/apache/hudi/pull/2242/diff?src=pr&el=tree#diff-aHVkaS11dGlsaXRpZXMvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2h1ZGkvdXRpbGl0aWVzL1V0aWxIZWxwZXJzLmphdmE=) | `62.94% <37.50%> (-1.26%)` | `31.00 <1.00> (+1.00)` | :arrow_down: |
   | [...i/utilities/deltastreamer/HoodieDeltaStreamer.java](https://codecov.io/gh/apache/hudi/pull/2242/diff?src=pr&el=tree#diff-aHVkaS11dGlsaXRpZXMvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2h1ZGkvdXRpbGl0aWVzL2RlbHRhc3RyZWFtZXIvSG9vZGllRGVsdGFTdHJlYW1lci5qYXZh) | `68.27% <80.00%> (-0.96%)` | `18.00 <0.00> (ø)` | |
   | [...di/utilities/config/HoodieDeltaStreamerConfig.java](https://codecov.io/gh/apache/hudi/pull/2242/diff?src=pr&el=tree#diff-aHVkaS11dGlsaXRpZXMvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2h1ZGkvdXRpbGl0aWVzL2NvbmZpZy9Ib29kaWVEZWx0YVN0cmVhbWVyQ29uZmlnLmphdmE=) | `100.00% <100.00%> (ø)` | `4.00 <4.00> (?)` | |
   | [...rg/apache/hudi/utilities/sources/CsvDFSSource.java](https://codecov.io/gh/apache/hudi/pull/2242/diff?src=pr&el=tree#diff-aHVkaS11dGlsaXRpZXMvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2h1ZGkvdXRpbGl0aWVzL3NvdXJjZXMvQ3N2REZTU291cmNlLmphdmE=) | `100.00% <100.00%> (ø)` | `10.00 <0.00> (ø)` | |
   | [...g/apache/hudi/utilities/sources/JsonDFSSource.java](https://codecov.io/gh/apache/hudi/pull/2242/diff?src=pr&el=tree#diff-aHVkaS11dGlsaXRpZXMvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2h1ZGkvdXRpbGl0aWVzL3NvdXJjZXMvSnNvbkRGU1NvdXJjZS5qYXZh) | `100.00% <100.00%> (ø)` | `4.00 <0.00> (ø)` | |
   | [...pache/hudi/utilities/sources/ParquetDFSSource.java](https://codecov.io/gh/apache/hudi/pull/2242/diff?src=pr&el=tree#diff-aHVkaS11dGlsaXRpZXMvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2h1ZGkvdXRpbGl0aWVzL3NvdXJjZXMvUGFycXVldERGU1NvdXJjZS5qYXZh) | `100.00% <100.00%> (ø)` | `5.00 <0.00> (ø)` | |
   | [...ties/sources/selector/AbstractDFSPathSelector.java](https://codecov.io/gh/apache/hudi/pull/2242/diff?src=pr&el=tree#diff-aHVkaS11dGlsaXRpZXMvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2h1ZGkvdXRpbGl0aWVzL3NvdXJjZXMvc2VsZWN0b3IvQWJzdHJhY3RERlNQYXRoU2VsZWN0b3IuamF2YQ==) | `100.00% <100.00%> (ø)` | `1.00 <1.00> (?)` | |
   | ... and [35 more](https://codecov.io/gh/apache/hudi/pull/2242/diff?src=pr&el=tree-more) | |
   


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



[GitHub] [hudi] codecov-io edited a comment on pull request #2242: [HUDI-1366] Make deltasteamer support exporting data from hdfs to hudi

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #2242:
URL: https://github.com/apache/hudi/pull/2242#issuecomment-730253264


   # [Codecov](https://codecov.io/gh/apache/hudi/pull/2242?src=pr&el=h1) Report
   > Merging [#2242](https://codecov.io/gh/apache/hudi/pull/2242?src=pr&el=desc) (5df432c) into [master](https://codecov.io/gh/apache/hudi/commit/d160abb43740e0bcdf40458c345ecd2d74e6698c?el=desc) (d160abb) will **decrease** coverage by `42.76%`.
   > The diff coverage is `0.00%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/hudi/pull/2242/graphs/tree.svg?width=650&height=150&src=pr&token=VTTXabwbs2)](https://codecov.io/gh/apache/hudi/pull/2242?src=pr&el=tree)
   
   ```diff
   @@              Coverage Diff              @@
   ##             master    #2242       +/-   ##
   =============================================
   - Coverage     53.10%   10.34%   -42.77%     
   + Complexity     2705       48     -2657     
   =============================================
     Files           346       53      -293     
     Lines         15922     1789    -14133     
     Branches       1633      214     -1419     
   =============================================
   - Hits           8456      185     -8271     
   + Misses         6772     1591     -5181     
   + Partials        694       13      -681     
   ```
   
   | Flag | Coverage Δ | Complexity Δ | |
   |---|---|---|---|
   | hudicli | `?` | `?` | |
   | hudiclient | `?` | `?` | |
   | hudicommon | `?` | `?` | |
   | hudihadoopmr | `?` | `?` | |
   | hudispark | `?` | `?` | |
   | huditimelineservice | `?` | `?` | |
   | hudiutilities | `10.34% <0.00%> (-59.03%)` | `0.00 <0.00> (ø)` | |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/hudi/pull/2242?src=pr&el=tree) | Coverage Δ | Complexity Δ | |
   |---|---|---|---|
   | [...in/java/org/apache/hudi/utilities/UtilHelpers.java](https://codecov.io/gh/apache/hudi/pull/2242/diff?src=pr&el=tree#diff-aHVkaS11dGlsaXRpZXMvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2h1ZGkvdXRpbGl0aWVzL1V0aWxIZWxwZXJzLmphdmE=) | `34.70% <0.00%> (-29.50%)` | `11.00 <0.00> (-19.00)` | |
   | [...di/utilities/config/HoodieDeltaStreamerConfig.java](https://codecov.io/gh/apache/hudi/pull/2242/diff?src=pr&el=tree#diff-aHVkaS11dGlsaXRpZXMvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2h1ZGkvdXRpbGl0aWVzL2NvbmZpZy9Ib29kaWVEZWx0YVN0cmVhbWVyQ29uZmlnLmphdmE=) | `0.00% <0.00%> (ø)` | `0.00 <0.00> (?)` | |
   | [...apache/hudi/utilities/deltastreamer/DeltaSync.java](https://codecov.io/gh/apache/hudi/pull/2242/diff?src=pr&el=tree#diff-aHVkaS11dGlsaXRpZXMvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2h1ZGkvdXRpbGl0aWVzL2RlbHRhc3RyZWFtZXIvRGVsdGFTeW5jLmphdmE=) | `0.00% <ø> (-70.55%)` | `0.00 <0.00> (-49.00)` | |
   | [...i/utilities/deltastreamer/HoodieDeltaStreamer.java](https://codecov.io/gh/apache/hudi/pull/2242/diff?src=pr&el=tree#diff-aHVkaS11dGlsaXRpZXMvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2h1ZGkvdXRpbGl0aWVzL2RlbHRhc3RyZWFtZXIvSG9vZGllRGVsdGFTdHJlYW1lci5qYXZh) | `0.00% <0.00%> (-69.24%)` | `0.00 <0.00> (-18.00)` | |
   | [...g/apache/hudi/utilities/sources/AvroDFSSource.java](https://codecov.io/gh/apache/hudi/pull/2242/diff?src=pr&el=tree#diff-aHVkaS11dGlsaXRpZXMvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2h1ZGkvdXRpbGl0aWVzL3NvdXJjZXMvQXZyb0RGU1NvdXJjZS5qYXZh) | `0.00% <0.00%> (ø)` | `0.00 <0.00> (ø)` | |
   | [...rg/apache/hudi/utilities/sources/CsvDFSSource.java](https://codecov.io/gh/apache/hudi/pull/2242/diff?src=pr&el=tree#diff-aHVkaS11dGlsaXRpZXMvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2h1ZGkvdXRpbGl0aWVzL3NvdXJjZXMvQ3N2REZTU291cmNlLmphdmE=) | `0.00% <0.00%> (-100.00%)` | `0.00 <0.00> (-10.00)` | |
   | [...g/apache/hudi/utilities/sources/JsonDFSSource.java](https://codecov.io/gh/apache/hudi/pull/2242/diff?src=pr&el=tree#diff-aHVkaS11dGlsaXRpZXMvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2h1ZGkvdXRpbGl0aWVzL3NvdXJjZXMvSnNvbkRGU1NvdXJjZS5qYXZh) | `0.00% <0.00%> (-100.00%)` | `0.00 <0.00> (-4.00)` | |
   | [...pache/hudi/utilities/sources/ParquetDFSSource.java](https://codecov.io/gh/apache/hudi/pull/2242/diff?src=pr&el=tree#diff-aHVkaS11dGlsaXRpZXMvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2h1ZGkvdXRpbGl0aWVzL3NvdXJjZXMvUGFycXVldERGU1NvdXJjZS5qYXZh) | `0.00% <0.00%> (-100.00%)` | `0.00 <0.00> (-5.00)` | |
   | [...ties/sources/selector/AbstractDFSPathSelector.java](https://codecov.io/gh/apache/hudi/pull/2242/diff?src=pr&el=tree#diff-aHVkaS11dGlsaXRpZXMvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2h1ZGkvdXRpbGl0aWVzL3NvdXJjZXMvc2VsZWN0b3IvQWJzdHJhY3RERlNQYXRoU2VsZWN0b3IuamF2YQ==) | `0.00% <0.00%> (ø)` | `0.00 <0.00> (?)` | |
   | [...di/utilities/sources/selector/DFSPathSelector.java](https://codecov.io/gh/apache/hudi/pull/2242/diff?src=pr&el=tree#diff-aHVkaS11dGlsaXRpZXMvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2h1ZGkvdXRpbGl0aWVzL3NvdXJjZXMvc2VsZWN0b3IvREZTUGF0aFNlbGVjdG9yLmphdmE=) | `0.00% <0.00%> (ø)` | `0.00 <0.00> (?)` | |
   | ... and [337 more](https://codecov.io/gh/apache/hudi/pull/2242/diff?src=pr&el=tree-more) | |
   


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



[GitHub] [hudi] liujinhui1994 commented on a change in pull request #2242: [HUDI-1366] Make deltasteamer support exporting data from hdfs to hudi

Posted by GitBox <gi...@apache.org>.
liujinhui1994 commented on a change in pull request #2242:
URL: https://github.com/apache/hudi/pull/2242#discussion_r528440808



##########
File path: hudi-utilities/src/main/java/org/apache/hudi/utilities/deltastreamer/HoodieDeltaStreamer.java
##########
@@ -522,14 +523,18 @@ public static void main(String[] args) throws Exception {
      */
     private transient DeltaSync deltaSync;
 
+    private final HoodieDeltaStreamerConfig deltaStreamerConfig;
+
     public DeltaSyncService(Config cfg, JavaSparkContext jssc, FileSystem fs, Configuration conf,
                             Option<TypedProperties> properties) throws IOException {
+      this.props = properties.get();
       this.cfg = cfg;
       this.jssc = jssc;
       this.sparkSession = SparkSession.builder().config(jssc.getConf()).getOrCreate();
       this.asyncCompactService = Option.empty();
+      this.deltaStreamerConfig = new HoodieDeltaStreamerConfig(props);
 
-      if (fs.exists(new Path(cfg.targetBasePath))) {
+      if (fs.exists(new Path(cfg.targetBasePath)) && !deltaStreamerConfig.getFullOverwrite()) {

Review comment:
       1.'deltaStreamerConfig.getFullOverwrite()' is only for dfsSouce, is it inappropriate to put it in the delta streamer command-line tool?
   2. There are more and more deltastreamer configurations, we can manage these in one class




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



[GitHub] [hudi] garyli1019 commented on a change in pull request #2242: [HUDI-1366] Make deltasteamer support exporting data from hdfs to hudi

Posted by GitBox <gi...@apache.org>.
garyli1019 commented on a change in pull request #2242:
URL: https://github.com/apache/hudi/pull/2242#discussion_r529169090



##########
File path: hudi-utilities/src/main/java/org/apache/hudi/utilities/sources/selector/AbstractDFSPathSelector.java
##########
@@ -0,0 +1,41 @@
+/*
+ * 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.hudi.utilities.sources.selector;
+
+import org.apache.hadoop.conf.Configuration;
+import org.apache.hudi.ApiMaturityLevel;
+import org.apache.hudi.PublicAPIClass;
+import org.apache.hudi.common.config.TypedProperties;
+import org.apache.hudi.common.util.Option;
+import org.apache.hudi.common.util.collection.Pair;
+import org.apache.hudi.utilities.config.HoodieDeltaStreamerConfig;
+
+@PublicAPIClass(maturity = ApiMaturityLevel.STABLE)
+public abstract class AbstractDFSPathSelector {

Review comment:
       Do you think we can make this simpler? I feel like making an Abstract class here was a bit overkill. 

##########
File path: hudi-utilities/src/main/java/org/apache/hudi/utilities/UtilHelpers.java
##########
@@ -152,8 +156,26 @@ public static InitialCheckPointProvider createInitialCheckpointProvider(
   }
 
   /**
-   *
+   * Factory method for creating custom DFSPathSelector.
    */
+  public static AbstractDFSPathSelector createSourceSelector(TypedProperties props, Configuration conf) {

Review comment:
       IMO we could keep this method inside the path related class if possible, so the code would be more straightforward. 

##########
File path: hudi-utilities/src/main/java/org/apache/hudi/utilities/UtilHelpers.java
##########
@@ -152,8 +156,26 @@ public static InitialCheckPointProvider createInitialCheckpointProvider(
   }
 
   /**
-   *
+   * Factory method for creating custom DFSPathSelector.
    */
+  public static AbstractDFSPathSelector createSourceSelector(TypedProperties props, Configuration conf) {
+
+    HoodieDeltaStreamerConfig deltaStreamerConfig = new HoodieDeltaStreamerConfig(props);
+    String sourceSelectorClass;
+    if (deltaStreamerConfig.getFullOverwrite()) {
+      sourceSelectorClass = OverwriteDFSPathSelector.class.getName();
+    } else {
+      sourceSelectorClass = deltaStreamerConfig.getInputSelector();

Review comment:
       Can we load the overwrite method through here?

##########
File path: hudi-utilities/src/main/java/org/apache/hudi/utilities/deltastreamer/HoodieDeltaStreamer.java
##########
@@ -522,14 +523,18 @@ public static void main(String[] args) throws Exception {
      */
     private transient DeltaSync deltaSync;
 
+    private final HoodieDeltaStreamerConfig deltaStreamerConfig;
+
     public DeltaSyncService(Config cfg, JavaSparkContext jssc, FileSystem fs, Configuration conf,
                             Option<TypedProperties> properties) throws IOException {
+      this.props = properties.get();
       this.cfg = cfg;
       this.jssc = jssc;
       this.sparkSession = SparkSession.builder().config(jssc.getConf()).getOrCreate();
       this.asyncCompactService = Option.empty();
+      this.deltaStreamerConfig = new HoodieDeltaStreamerConfig(props);
 
-      if (fs.exists(new Path(cfg.targetBasePath))) {
+      if (fs.exists(new Path(cfg.targetBasePath)) && !deltaStreamerConfig.getFullOverwrite()) {

Review comment:
       If a user would like to use overwrite through the command-line tool, is there any way to do that?




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