[HUDI-595] code cleanup, refactoring code out of PR# 1159 (#1302)
This commit is contained in:
@@ -333,8 +333,7 @@ public class HoodieCombineHiveInputFormat<K extends WritableComparable, V extend
|
||||
if (o instanceof CombinePathInputFormat) {
|
||||
CombinePathInputFormat mObj = (CombinePathInputFormat) o;
|
||||
return (opList.equals(mObj.opList)) && (inputFormatClassName.equals(mObj.inputFormatClassName))
|
||||
&& (deserializerClassName == null ? (mObj.deserializerClassName == null)
|
||||
: deserializerClassName.equals(mObj.deserializerClassName));
|
||||
&& (Objects.equals(deserializerClassName, mObj.deserializerClassName));
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@@ -353,16 +352,16 @@ public class HoodieCombineHiveInputFormat<K extends WritableComparable, V extend
|
||||
init(job);
|
||||
Map<Path, ArrayList<String>> pathToAliases = mrwork.getPathToAliases();
|
||||
Map<String, Operator<? extends OperatorDesc>> aliasToWork = mrwork.getAliasToWork();
|
||||
/** MOD - Initialize a custom combine input format shim that will call listStatus on the custom inputFormat **/
|
||||
/* MOD - Initialize a custom combine input format shim that will call listStatus on the custom inputFormat **/
|
||||
HoodieCombineHiveInputFormat.HoodieCombineFileInputFormatShim combine =
|
||||
new HoodieCombineHiveInputFormat.HoodieCombineFileInputFormatShim();
|
||||
new HoodieCombineHiveInputFormat.HoodieCombineFileInputFormatShim<>();
|
||||
|
||||
InputSplit[] splits;
|
||||
|
||||
if (combine.getInputPathsShim(job).length == 0) {
|
||||
throw new IOException("No input paths specified in job");
|
||||
}
|
||||
ArrayList<InputSplit> result = new ArrayList<>();
|
||||
List<InputSplit> result = new ArrayList<>();
|
||||
|
||||
// combine splits only from same tables and same partitions. Do not combine splits from multiple
|
||||
// tables or multiple partitions.
|
||||
|
||||
@@ -210,7 +210,7 @@ public class TestHoodieRealtimeRecordReader {
|
||||
action.equals(HoodieTimeline.ROLLBACK_ACTION) ? String.valueOf(baseInstantTs + logVersion - 2)
|
||||
: instantTime;
|
||||
|
||||
HoodieLogFormat.Writer writer = null;
|
||||
HoodieLogFormat.Writer writer;
|
||||
if (action.equals(HoodieTimeline.ROLLBACK_ACTION)) {
|
||||
writer = writeRollback(partitionDir, schema, "fileid0", baseInstant, instantTime,
|
||||
String.valueOf(baseInstantTs + logVersion - 1), logVersion);
|
||||
@@ -317,7 +317,7 @@ public class TestHoodieRealtimeRecordReader {
|
||||
numRecordsAtCommit2++;
|
||||
Assert.assertTrue(gotKey > firstBatchLastRecordKey);
|
||||
Assert.assertTrue(gotKey <= secondBatchLastRecordKey);
|
||||
assertEquals((int) gotKey, lastSeenKeyFromLog + 1);
|
||||
assertEquals(gotKey, lastSeenKeyFromLog + 1);
|
||||
lastSeenKeyFromLog++;
|
||||
} else {
|
||||
numRecordsAtCommit1++;
|
||||
@@ -491,7 +491,6 @@ public class TestHoodieRealtimeRecordReader {
|
||||
writer = writeRollbackBlockToLogFile(partitionDir, schema, "fileid0", commitTime, newCommitTime, "101", 1);
|
||||
logFilePaths.add(writer.getLogFile().getPath().toString());
|
||||
writer.close();
|
||||
assertTrue("block - size should be > 0", size > 0);
|
||||
InputFormatTestUtil.deltaCommit(basePath, newCommitTime);
|
||||
|
||||
// create a split with baseFile (parquet file written earlier) and new log file(s)
|
||||
|
||||
Reference in New Issue
Block a user