-
Notifications
You must be signed in to change notification settings - Fork 2.5k
[HUDI-2538] persist some configs to hoodie.properties when the first write #3823
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -33,6 +33,8 @@ | |
| import org.junit.jupiter.api.Test; | ||
|
|
||
| import java.io.IOException; | ||
| import java.io.PrintWriter; | ||
| import java.io.StringWriter; | ||
|
|
||
| public class TestCustomKeyGenerator extends KeyGeneratorTestUtilities { | ||
|
|
||
|
|
@@ -122,6 +124,13 @@ private TypedProperties getPropertiesForNonPartitionedKeyGen(boolean useKeyGener | |
| return properties; | ||
| } | ||
|
|
||
| private String stackTraceToString(Throwable e) { | ||
| StringWriter sw = new StringWriter(); | ||
| PrintWriter pw = new PrintWriter(sw); | ||
| e.printStackTrace(pw); | ||
| return sw.toString(); | ||
| } | ||
|
|
||
| @Test | ||
| public void testSimpleKeyGeneratorWithKeyGeneratorClass() throws IOException { | ||
| testSimpleKeyGenerator(getPropertiesForSimpleKeyGen(true)); | ||
|
|
@@ -259,7 +268,7 @@ public void testNoRecordKeyFieldProp(boolean useKeyGeneratorClassName) { | |
| .getMessage() | ||
| .contains("Property hoodie.datasource.write.recordkey.field not found")); | ||
| } else { | ||
| Assertions.assertTrue(e.getMessage().contains("Property hoodie.datasource.write.recordkey.field not found")); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why need the change here?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I refactor the method |
||
| Assertions.assertTrue(stackTraceToString(e).contains("Property hoodie.datasource.write.recordkey.field not found")); | ||
| } | ||
|
|
||
| } | ||
|
|
@@ -282,7 +291,7 @@ public void testNoRecordKeyFieldProp(boolean useKeyGeneratorClassName) { | |
| .getMessage() | ||
| .contains("Property hoodie.datasource.write.recordkey.field not found")); | ||
| } else { | ||
| Assertions.assertTrue(e.getMessage().contains("Property hoodie.datasource.write.recordkey.field not found")); | ||
| Assertions.assertTrue(stackTraceToString(e).contains("Property hoodie.datasource.write.recordkey.field not found")); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ditto |
||
| } | ||
| } | ||
| } | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.