bhasudha commented on a change in pull request #1987:
URL: https://github.com/apache/hudi/pull/1987#discussion_r473289742



##########
File path: 
hudi-spark/src/main/java/org/apache/hudi/keygen/TimestampBasedKeyGenerator.java
##########
@@ -153,7 +147,8 @@ public String getPartitionPath(GenericRecord record) {
    * @return the parsed partition path based on data type
    * @throws ParseException on any parse exception
    */
-  private String getPartitionPath(Object partitionVal) throws ParseException {
+  private String getPartitionPath(Object partitionVal) {
+    DateTimeFormatter inputFormatter = parser.getInputFormatter();

Review comment:
       @pratyakshsharma  InitIfNeeded() should be called from getPartitionPath 
that way for each getPartitionPath() call we dont create DateTimeFormatter 
objects. And initIfNeeded() should check for `if (inputFormatter == null) {`. 
The variables will be marked transient and dont get initialized in the 
constructor.




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


Reply via email to