1
0

[HUDI-2079] Make CLI command tests functional (#3601)

Make all tests in org.apache.hudi.cli.commands extend org.apache.hudi.cli.functional.CLIFunctionalTestHarness and tag as "functional".

This also resolves a blocker where DFS init consistently failed when moving to ubuntu 18.04
This commit is contained in:
Raymond Xu
2021-09-06 15:53:53 -07:00
committed by GitHub
parent f218693f5d
commit cf002b6918
20 changed files with 459 additions and 247 deletions

View File

@@ -44,7 +44,7 @@ public class HoodieCLI {
protected static HoodieTableMetaClient tableMetadata;
public static HoodieTableMetaClient syncTableMetadata;
public static TimelineLayoutVersion layoutVersion;
private static TempViewProvider tempViewProvider;
public static TempViewProvider tempViewProvider;
/**
* Enum for CLI state.
@@ -114,17 +114,4 @@ public class HoodieCLI {
return tempViewProvider;
}
/**
* Close tempViewProvider.
* <p/>
* For test, avoid multiple SparkContexts.
*/
public static synchronized void closeTempViewProvider() {
if (tempViewProvider != null) {
tempViewProvider.close();
tempViewProvider = null;
}
}
}

View File

@@ -56,6 +56,11 @@ public class SparkTempViewProvider implements TempViewProvider {
}
}
public SparkTempViewProvider(JavaSparkContext jsc, SQLContext sqlContext) {
this.jsc = jsc;
this.sqlContext = sqlContext;
}
@Override
public void createOrReplace(String tableName, List<String> headers, List<List<Comparable>> rows) {
try {