1
0

[HUDI-1869] Upgrading Spark3 To 3.1 (#3844)

Co-authored-by: pengzhiwei <pengzhiwei2015@icloud.com>
This commit is contained in:
Yann Byron
2021-11-03 09:25:12 +08:00
committed by GitHub
parent dee3a14aae
commit 1f17467f73
22 changed files with 315 additions and 57 deletions

View File

@@ -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>

View File

@@ -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() {