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/02/27 15:21:42 UTC

[GitHub] [hudi] stayrascal opened a new pull request #4920: [MINOR] Fix String convert issue and overwrite putAll method in Typed…

stayrascal opened a new pull request #4920:
URL: https://github.com/apache/hudi/pull/4920


   …Properties.java
   
   ## *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
   
   I'm running Flink with Hudi in Java 11 environment(Even through I know Hudi might only support Java8/9/10), But we cannot change our JDK version. Based on this situation, We meet a NPE problem during `HoodieWriteConfig.getIndexType()`, but I test that it works in my local Java 8 environment. It seems that we implemented a `TypedProperties` inherit `Properties`, and overwrite `stringPropertyNames` method & `put` method.
   
   There are some difference of `Properties.putAll(Map<?,?> t)` between Java 8 and Java 11. 
   
   *Java 8*: `TypedProperties`  will use HashTable's `putAll` method, which will call `TypedProperties.put` which will add the incoming keys in `TypedProperties.keys`
   ```
   public synchronized void putAll(Map<? extends K, ? extends V> t) {
           for (Map.Entry<? extends K, ? extends V> e : t.entrySet())
               put(e.getKey(), e.getValue());
       }
   ```
   
   *Java 11*: `Properties` overwrite `putAll` method, and delegate the  incoming map to `ConcurrentHashMap`. won't call `TypedProperties.put` anymore, which lead the `TypedProperties.keys` miss some keys, and then it cause we miss the `hoodie.index.type` configuration.
   ```
   @Override
       public synchronized void putAll(Map<?, ?> t) {
           map.putAll(t);
       }
   ```
   
   So we also need to overwrite `putAll` method to better  suitable high Java version runtime.
   
   ## Brief change log
   
     - *Overwrite `putAll` method in `TypedPropertis`*
     - *Add class type checking before convert to String hardly*
   
   ## Verify this pull request
   
   This change added tests and can be verified as follows:
   
     - *Add unit test case to test `putAll` cases in TestTypedProperties.java*
   
   ## 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 removed a comment on pull request #4920: [MINOR] Fix String convert issue and overwrite putAll method in Typed…

Posted by GitBox <gi...@apache.org>.
hudi-bot removed a comment on pull request #4920:
URL: https://github.com/apache/hudi/pull/4920#issuecomment-1053587945


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "7a602cc73003c800e1694a980f1f61df646f4198",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "7a602cc73003c800e1694a980f1f61df646f4198",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 7a602cc73003c800e1694a980f1f61df646f4198 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 removed a comment on pull request #4920: [MINOR] Fix String convert issue and overwrite putAll method in Typed…

Posted by GitBox <gi...@apache.org>.
hudi-bot removed a comment on pull request #4920:
URL: https://github.com/apache/hudi/pull/4920#issuecomment-1053588724


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "7a602cc73003c800e1694a980f1f61df646f4198",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=6362",
       "triggerID" : "7a602cc73003c800e1694a980f1f61df646f4198",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 7a602cc73003c800e1694a980f1f61df646f4198 Azure: [PENDING](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=6362) 
   
   <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 #4920: [MINOR] Fix String convert issue and overwrite putAll method in Typed…

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


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "7a602cc73003c800e1694a980f1f61df646f4198",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=6362",
       "triggerID" : "7a602cc73003c800e1694a980f1f61df646f4198",
       "triggerType" : "PUSH"
     }, {
       "hash" : "80b76f21f4529ab29d20dec9b123035a33853ae5",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "80b76f21f4529ab29d20dec9b123035a33853ae5",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 7a602cc73003c800e1694a980f1f61df646f4198 Azure: [FAILURE](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=6362) 
   * 80b76f21f4529ab29d20dec9b123035a33853ae5 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 removed a comment on pull request #4920: [MINOR] Fix String convert issue and overwrite putAll method in Typed…

Posted by GitBox <gi...@apache.org>.
hudi-bot removed a comment on pull request #4920:
URL: https://github.com/apache/hudi/pull/4920#issuecomment-1053605251


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "7a602cc73003c800e1694a980f1f61df646f4198",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=6362",
       "triggerID" : "7a602cc73003c800e1694a980f1f61df646f4198",
       "triggerType" : "PUSH"
     }, {
       "hash" : "80b76f21f4529ab29d20dec9b123035a33853ae5",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "80b76f21f4529ab29d20dec9b123035a33853ae5",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 7a602cc73003c800e1694a980f1f61df646f4198 Azure: [FAILURE](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=6362) 
   * 80b76f21f4529ab29d20dec9b123035a33853ae5 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] stayrascal commented on a change in pull request #4920: #4923 Fix String convert issue and overwrite putAll method in Typed…

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



##########
File path: hudi-common/src/test/java/org/apache/hudi/common/properties/TestTypedProperties.java
##########
@@ -99,8 +99,37 @@ public void testPropertiesOrder() throws IOException {
     properties.put("key9", "true");
 
     TypedProperties typedProperties = new TypedProperties(properties);
+    assertTypeProperties(typedProperties, 0);
+  }
+
+  @Test
+  void testPutAllProperties() {

Review comment:
       it still works with Java 8, but will fail with Java 11.




-- 
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 #4920: [MINOR] Fix String convert issue and overwrite putAll method in Typed…

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


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "7a602cc73003c800e1694a980f1f61df646f4198",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=6362",
       "triggerID" : "7a602cc73003c800e1694a980f1f61df646f4198",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 7a602cc73003c800e1694a980f1f61df646f4198 Azure: [PENDING](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=6362) 
   
   <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 #4920: [MINOR] Fix String convert issue and overwrite putAll method in Typed…

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


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "7a602cc73003c800e1694a980f1f61df646f4198",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=6362",
       "triggerID" : "7a602cc73003c800e1694a980f1f61df646f4198",
       "triggerType" : "PUSH"
     }, {
       "hash" : "80b76f21f4529ab29d20dec9b123035a33853ae5",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=6364",
       "triggerID" : "80b76f21f4529ab29d20dec9b123035a33853ae5",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 80b76f21f4529ab29d20dec9b123035a33853ae5 Azure: [SUCCESS](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=6364) 
   
   <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] stayrascal commented on pull request #4920: #4923 Fix String convert issue and overwrite putAll method in Typed…

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


   > 
   
   Thanks @nsivabalan review this PR. I failed to create a Jira card, not sure where I can create the card or I didn't have the permission. Instead, I create an issue [here](https://github.com/apache/hudi/issues/4923).


-- 
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 #4920: [MINOR] Fix String convert issue and overwrite putAll method in Typed…

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


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "7a602cc73003c800e1694a980f1f61df646f4198",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "7a602cc73003c800e1694a980f1f61df646f4198",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 7a602cc73003c800e1694a980f1f61df646f4198 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] nsivabalan commented on a change in pull request #4920: [MINOR] Fix String convert issue and overwrite putAll method in Typed…

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



##########
File path: hudi-common/src/main/java/org/apache/hudi/common/config/TypedProperties.java
##########
@@ -63,11 +64,22 @@ public Enumeration propertyNames() {
   public Set<String> stringPropertyNames() {
     Set<String> set = new LinkedHashSet<>();
     for (Object key : this.keys) {
-      set.add((String) key);
+      if (key instanceof String) {
+        set.add((String) key);
+      }
     }
     return set;
   }
 
+  public synchronized void putAll(Properties t) {
+    for (Map.Entry<?, ?> e : t.entrySet()) {
+      if (!containsKey(String.valueOf(e.getKey()))) {
+        keys.add(e.getKey());
+      }
+      super.put(e.getKey(), e.getValue());

Review comment:
       may be we can remove "super". 




-- 
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] nsivabalan commented on a change in pull request #4920: [MINOR] Fix String convert issue and overwrite putAll method in Typed…

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



##########
File path: hudi-common/src/test/java/org/apache/hudi/common/properties/TestTypedProperties.java
##########
@@ -99,8 +99,37 @@ public void testPropertiesOrder() throws IOException {
     properties.put("key9", "true");
 
     TypedProperties typedProperties = new TypedProperties(properties);
+    assertTypeProperties(typedProperties, 0);
+  }
+
+  @Test
+  void testPutAllProperties() {

Review comment:
       is this test failing w/o the fix in this patch ? 




-- 
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] nsivabalan commented on pull request #4920: [MINOR] Fix String convert issue and overwrite putAll method in Typed…

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


   CC @codope. 


-- 
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 removed a comment on pull request #4920: [MINOR] Fix String convert issue and overwrite putAll method in Typed…

Posted by GitBox <gi...@apache.org>.
hudi-bot removed a comment on pull request #4920:
URL: https://github.com/apache/hudi/pull/4920#issuecomment-1053606765


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "7a602cc73003c800e1694a980f1f61df646f4198",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=6362",
       "triggerID" : "7a602cc73003c800e1694a980f1f61df646f4198",
       "triggerType" : "PUSH"
     }, {
       "hash" : "80b76f21f4529ab29d20dec9b123035a33853ae5",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=6364",
       "triggerID" : "80b76f21f4529ab29d20dec9b123035a33853ae5",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 7a602cc73003c800e1694a980f1f61df646f4198 Azure: [FAILURE](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=6362) 
   * 80b76f21f4529ab29d20dec9b123035a33853ae5 Azure: [PENDING](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=6364) 
   
   <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 #4920: [MINOR] Fix String convert issue and overwrite putAll method in Typed…

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


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "7a602cc73003c800e1694a980f1f61df646f4198",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=6362",
       "triggerID" : "7a602cc73003c800e1694a980f1f61df646f4198",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 7a602cc73003c800e1694a980f1f61df646f4198 Azure: [FAILURE](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=6362) 
   
   <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] nsivabalan commented on pull request #4920: [MINOR] Fix String convert issue and overwrite putAll method in Typed…

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


   @stayrascal : this does not looks like minor. can you please file a jira and link it. 


-- 
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] stayrascal commented on a change in pull request #4920: #4923 Fix String convert issue and overwrite putAll method in Typed…

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



##########
File path: hudi-common/src/main/java/org/apache/hudi/common/config/TypedProperties.java
##########
@@ -63,11 +64,22 @@ public Enumeration propertyNames() {
   public Set<String> stringPropertyNames() {
     Set<String> set = new LinkedHashSet<>();
     for (Object key : this.keys) {
-      set.add((String) key);
+      if (key instanceof String) {
+        set.add((String) key);
+      }
     }
     return set;
   }
 
+  public synchronized void putAll(Properties t) {
+    for (Map.Entry<?, ?> e : t.entrySet()) {
+      if (!containsKey(String.valueOf(e.getKey()))) {
+        keys.add(e.getKey());
+      }
+      super.put(e.getKey(), e.getValue());

Review comment:
       What I'm thinking there about using `super.put` is that we have already add the keys into current keys(`LinkedHashset`), if we still call `this.put`, it will remove the key again and add the key later in the `LinkedHashset`, it seems that we don't need to update the key position in the `LinkedHashset`.




-- 
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] nsivabalan merged pull request #4920: [HUDI-3528] Fix String convert issue and overwrite putAll method in Typed…

Posted by GitBox <gi...@apache.org>.
nsivabalan merged pull request #4920:
URL: https://github.com/apache/hudi/pull/4920


   


-- 
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 #4920: [MINOR] Fix String convert issue and overwrite putAll method in Typed…

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


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "7a602cc73003c800e1694a980f1f61df646f4198",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=6362",
       "triggerID" : "7a602cc73003c800e1694a980f1f61df646f4198",
       "triggerType" : "PUSH"
     }, {
       "hash" : "80b76f21f4529ab29d20dec9b123035a33853ae5",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=6364",
       "triggerID" : "80b76f21f4529ab29d20dec9b123035a33853ae5",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 7a602cc73003c800e1694a980f1f61df646f4198 Azure: [FAILURE](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=6362) 
   * 80b76f21f4529ab29d20dec9b123035a33853ae5 Azure: [PENDING](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=6364) 
   
   <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 removed a comment on pull request #4920: [MINOR] Fix String convert issue and overwrite putAll method in Typed…

Posted by GitBox <gi...@apache.org>.
hudi-bot removed a comment on pull request #4920:
URL: https://github.com/apache/hudi/pull/4920#issuecomment-1053589584


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "7a602cc73003c800e1694a980f1f61df646f4198",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=6362",
       "triggerID" : "7a602cc73003c800e1694a980f1f61df646f4198",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 7a602cc73003c800e1694a980f1f61df646f4198 Azure: [FAILURE](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=6362) 
   
   <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] codope commented on a change in pull request #4920: [HUDI-3528] Fix String convert issue and overwrite putAll method in Typed…

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



##########
File path: hudi-common/src/main/java/org/apache/hudi/common/config/TypedProperties.java
##########
@@ -63,11 +64,22 @@ public Enumeration propertyNames() {
   public Set<String> stringPropertyNames() {
     Set<String> set = new LinkedHashSet<>();
     for (Object key : this.keys) {
-      set.add((String) key);
+      if (key instanceof String) {
+        set.add((String) key);
+      }
     }
     return set;
   }
 
+  public synchronized void putAll(Properties t) {
+    for (Map.Entry<?, ?> e : t.entrySet()) {
+      if (!containsKey(String.valueOf(e.getKey()))) {
+        keys.add(e.getKey());
+      }
+      super.put(e.getKey(), e.getValue());

Review comment:
       Sorry, i get your point now. The key position in the set itself need not be updated.

##########
File path: hudi-common/src/main/java/org/apache/hudi/common/config/TypedProperties.java
##########
@@ -63,11 +64,22 @@ public Enumeration propertyNames() {
   public Set<String> stringPropertyNames() {
     Set<String> set = new LinkedHashSet<>();
     for (Object key : this.keys) {
-      set.add((String) key);
+      if (key instanceof String) {
+        set.add((String) key);
+      }
     }
     return set;
   }
 
+  public synchronized void putAll(Properties t) {
+    for (Map.Entry<?, ?> e : t.entrySet()) {
+      if (!containsKey(String.valueOf(e.getKey()))) {
+        keys.add(e.getKey());
+      }
+      super.put(e.getKey(), e.getValue());

Review comment:
       Actually we do need to update the key position. The reason `LinkedHashSet` was added to `TypedProperties` is so that the order of keys is maintained.




-- 
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