From 0c821fecc2140683de24d9b350c8142b4b8b8c47 Mon Sep 17 00:00:00 2001 From: jshmchenxi Date: Tue, 22 Dec 2020 09:02:23 +0800 Subject: [PATCH] [MINOR] Pass root exception to HoodieKeyGeneratorException for more information (#2354) Co-authored-by: Xi Chen --- .../java/org/apache/hudi/keygen/CustomAvroKeyGenerator.java | 2 +- .../main/java/org/apache/hudi/keygen/CustomKeyGenerator.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/hudi-client/hudi-client-common/src/main/java/org/apache/hudi/keygen/CustomAvroKeyGenerator.java b/hudi-client/hudi-client-common/src/main/java/org/apache/hudi/keygen/CustomAvroKeyGenerator.java index 6266fd15c..724cabdc7 100644 --- a/hudi-client/hudi-client-common/src/main/java/org/apache/hudi/keygen/CustomAvroKeyGenerator.java +++ b/hudi-client/hudi-client-common/src/main/java/org/apache/hudi/keygen/CustomAvroKeyGenerator.java @@ -88,7 +88,7 @@ public class CustomAvroKeyGenerator extends BaseKeyGenerator { try { partitionPath.append(new TimestampBasedAvroKeyGenerator(config, partitionPathField).getPartitionPath(record)); } catch (IOException e) { - throw new HoodieKeyGeneratorException("Unable to initialise TimestampBasedKeyGenerator class"); + throw new HoodieKeyGeneratorException("Unable to initialise TimestampBasedKeyGenerator class", e); } break; default: diff --git a/hudi-client/hudi-spark-client/src/main/java/org/apache/hudi/keygen/CustomKeyGenerator.java b/hudi-client/hudi-spark-client/src/main/java/org/apache/hudi/keygen/CustomKeyGenerator.java index 6727b79d7..77896d2e8 100644 --- a/hudi-client/hudi-spark-client/src/main/java/org/apache/hudi/keygen/CustomKeyGenerator.java +++ b/hudi-client/hudi-spark-client/src/main/java/org/apache/hudi/keygen/CustomKeyGenerator.java @@ -113,7 +113,7 @@ public class CustomKeyGenerator extends BuiltinKeyGenerator { partitionPath.append(new TimestampBasedKeyGenerator(config, partitionPathField).getPartitionPath(row.get())); } } catch (IOException ioe) { - throw new HoodieKeyGeneratorException("Unable to initialise TimestampBasedKeyGenerator class"); + throw new HoodieKeyGeneratorException("Unable to initialise TimestampBasedKeyGenerator class", ioe); } break; default: