[HUDI-1869] Upgrading Spark3 To 3.1 (#3844)
Co-authored-by: pengzhiwei <pengzhiwei2015@icloud.com>
This commit is contained in:
@@ -153,6 +153,12 @@
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.apache.spark</groupId>
|
||||
<artifactId>spark-core_${scala.binary.version}</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<!-- Needed for running HiveServer for Tests -->
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty.aggregate</groupId>
|
||||
|
||||
@@ -36,7 +36,19 @@ import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
public class TestParquet2SparkSchemaUtils {
|
||||
private final SparkToParquetSchemaConverter spark2ParquetConverter =
|
||||
new SparkToParquetSchemaConverter(new SQLConf());
|
||||
private final SparkSqlParser parser = new SparkSqlParser(new SQLConf());
|
||||
private final SparkSqlParser parser = createSqlParser();
|
||||
|
||||
private static SparkSqlParser createSqlParser() {
|
||||
try {
|
||||
return SparkSqlParser.class.getDeclaredConstructor(SQLConf.class).newInstance(new SQLConf());
|
||||
} catch (Exception ne) {
|
||||
try { // For spark 3.1, there is no constructor with SQLConf, use the default constructor
|
||||
return SparkSqlParser.class.getDeclaredConstructor().newInstance();
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testConvertPrimitiveType() {
|
||||
|
||||
Reference in New Issue
Block a user