[HUDI-484] Fix NPE when reading IncrementalPull.sqltemplate in HiveIncrementalPuller (#1167)
This commit is contained in:
committed by
vinoth chandar
parent
7031445eb3
commit
28ccf8c521
@@ -112,7 +112,7 @@ public class HiveIncrementalPuller {
|
|||||||
this.config = config;
|
this.config = config;
|
||||||
validateConfig(config);
|
validateConfig(config);
|
||||||
String templateContent =
|
String templateContent =
|
||||||
FileIOUtils.readAsUTFString(this.getClass().getResourceAsStream("IncrementalPull.sqltemplate"));
|
FileIOUtils.readAsUTFString(this.getClass().getResourceAsStream("/IncrementalPull.sqltemplate"));
|
||||||
incrementalPullSQLtemplate = new ST(templateContent);
|
incrementalPullSQLtemplate = new ST(templateContent);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,27 @@
|
|||||||
|
package org.apache.hudi.utilities;
|
||||||
|
|
||||||
|
import org.junit.Assert;
|
||||||
|
import org.junit.Before;
|
||||||
|
import org.junit.Test;
|
||||||
|
|
||||||
|
public class TestHiveIncrementalPuller {
|
||||||
|
|
||||||
|
private HiveIncrementalPuller.Config config;
|
||||||
|
|
||||||
|
@Before
|
||||||
|
public void setup() {
|
||||||
|
config = new HiveIncrementalPuller.Config();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testInitHiveIncrementalPuller() {
|
||||||
|
|
||||||
|
try {
|
||||||
|
new HiveIncrementalPuller(config);
|
||||||
|
} catch (Exception e) {
|
||||||
|
Assert.fail("Unexpected exception while initing HiveIncrementalPuller, msg: " + e.getMessage());
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user