wangxianghu commented on a change in pull request #3006:
URL: https://github.com/apache/hudi/pull/3006#discussion_r642399929
##########
File path: hudi-flink/src/main/java/org/apache/hudi/util/StreamerUtil.java
##########
@@ -242,7 +242,9 @@ public static TypedProperties
flinkConf2TypedProperties(Configuration conf) {
properties.put(option.key(), option.defaultValue());
}
}
- return new TypedProperties(properties);
+ TypedProperties typeProps = new TypedProperties();
+ typeProps.putAll(typeProps);
Review comment:
> @wangxianghu
>
> ```
> @Test
> public void testTypedProperties() throws NoSuchFieldException,
IllegalAccessException {
> Properties prop = new Properties();
> prop.put("hudi_key_1", "hoodie");
>
> TypedProperties typedProperties = new TypedProperties(prop);
> Assert.assertEquals("hoodie", typedProperties.getString("hudi_key_1"));
>
> typedProperties.put("hudi_key_2", "hoodie");
> Assert.assertEquals("hoodie", typedProperties.getString("hudi_key_2"));
>
> HoodieWriteConfig.Builder builder = HoodieWriteConfig.newBuilder()
> .withProps(typedProperties);
>
> Field props =
HoodieWriteConfig.Builder.class.getDeclaredField("props");
> props.setAccessible(true);
>
> String hudi_key_1 = ((Properties)
props.get(builder)).getProperty("hudi_key_1");
> Assert.assertNull(hudi_key_1);
> String hudi_key_2 = ((Properties)
props.get(builder)).getProperty("hudi_key_2");
> Assert.assertEquals("hoodie", (hudi_key_2));
>
> }
> ```
I get your point, values stored in different places. is this a problem in
your scenes?
I am not sure if this change is necessary, since very few people would use
reflection to get the values.
@vinothchandar could you please take a look as well?
--
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:
[email protected]