Skip to content

Commit a2c9901

Browse files
Spark35 and Spark40 add iceberg test
1 parent 36a3b8f commit a2c9901

File tree

57 files changed

+124
-21
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+124
-21
lines changed

.github/workflows/velox_backend_x86.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -938,7 +938,7 @@ jobs:
938938
export JAVA_HOME=/usr/lib/jvm/java-17-openjdk
939939
export PATH=$JAVA_HOME/bin:$PATH
940940
java -version
941-
$MVN_CMD clean test -Pspark-3.5 -Pjava-17 -Pbackends-velox -Piceberg -Pdelta -Phudi -Ppaimon -Pspark-ut \
941+
$MVN_CMD clean test -Pspark-3.5 -Pjava-17 -Pbackends-velox -Piceberg -Piceberg-test -Pdelta -Phudi -Ppaimon -Pspark-ut \
942942
-DargLine="-Dspark.test.home=/opt/shims/spark35/spark_home/" \
943943
-DtagsToExclude=org.apache.spark.tags.ExtendedSQLTest,org.apache.gluten.tags.UDFTest,org.apache.gluten.tags.EnhancedFeaturesTest,org.apache.gluten.tags.SkipTest
944944
- name: Upload test report
@@ -1357,6 +1357,7 @@ jobs:
13571357
export PATH=$JAVA_HOME/bin:$PATH
13581358
java -version
13591359
$MVN_CMD clean test -Pspark-4.0 -Pscala-2.13 -Pjava-17 -Pbackends-velox \
1360+
-Piceberg -Piceberg-test \
13601361
-Pspark-ut -DargLine="-Dspark.test.home=/opt/shims/spark40/spark_home/" \
13611362
-DtagsToExclude=org.apache.spark.tags.ExtendedSQLTest,org.apache.gluten.tags.UDFTest,org.apache.gluten.tags.EnhancedFeaturesTest,org.apache.gluten.tags.SkipTest
13621363
- name: Upload test report
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one or more
3+
* contributor license agreements. See the NOTICE file distributed with
4+
* this work for additional information regarding copyright ownership.
5+
* The ASF licenses this file to You under the Apache License, Version 2.0
6+
* (the "License"); you may not use this file except in compliance with
7+
* the License. You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
17+
package org.apache.gluten;
18+
19+
import org.apache.spark.rdd.RDD;
20+
import org.apache.spark.sql.Dataset;
21+
import org.apache.spark.sql.Row;
22+
import org.apache.spark.sql.SparkSession;
23+
import org.apache.spark.sql.catalyst.InternalRow;
24+
import org.apache.spark.sql.types.StructType;
25+
26+
public class IcebergTestShims {
27+
28+
public static Dataset<Row> internalCreateDataFrame(
29+
SparkSession spark, RDD<InternalRow> rdd, StructType schema, boolean isStreaming) {
30+
return spark.internalCreateDataFrame(rdd, schema, isStreaming);
31+
}
32+
}
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one or more
3+
* contributor license agreements. See the NOTICE file distributed with
4+
* this work for additional information regarding copyright ownership.
5+
* The ASF licenses this file to You under the Apache License, Version 2.0
6+
* (the "License"); you may not use this file except in compliance with
7+
* the License. You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
17+
package org.apache.gluten;
18+
19+
import org.apache.spark.rdd.RDD;
20+
import org.apache.spark.sql.Dataset;
21+
import org.apache.spark.sql.Row;
22+
import org.apache.spark.sql.SparkSession;
23+
import org.apache.spark.sql.catalyst.InternalRow;
24+
import org.apache.spark.sql.types.StructType;
25+
26+
public class IcebergTestShims {
27+
28+
public static Dataset<Row> internalCreateDataFrame(
29+
SparkSession spark, RDD<InternalRow> rdd, StructType schema, boolean isStreaming) {
30+
return spark.internalCreateDataFrame(rdd, schema, isStreaming);
31+
}
32+
}
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one or more
3+
* contributor license agreements. See the NOTICE file distributed with
4+
* this work for additional information regarding copyright ownership.
5+
* The ASF licenses this file to You under the Apache License, Version 2.0
6+
* (the "License"); you may not use this file except in compliance with
7+
* the License. You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
17+
package org.apache.gluten;
18+
19+
import org.apache.spark.rdd.RDD;
20+
import org.apache.spark.sql.Dataset;
21+
import org.apache.spark.sql.Row;
22+
import org.apache.spark.sql.SparkSession;
23+
import org.apache.spark.sql.catalyst.InternalRow;
24+
import org.apache.spark.sql.types.StructType;
25+
26+
public class IcebergTestShims {
27+
28+
public static Dataset<Row> internalCreateDataFrame(
29+
SparkSession spark, RDD<InternalRow> rdd, StructType schema, boolean isStreaming) {
30+
return ((org.apache.spark.sql.classic.SparkSession) spark)
31+
.internalCreateDataFrame(rdd, schema, isStreaming);
32+
}
33+
}
Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
*/
1717
package org.apache.gluten.execution;
1818

19+
import org.apache.gluten.IcebergTestShims;
20+
1921
import org.apache.commons.lang3.StringUtils;
2022
import org.apache.iceberg.PlanningMode;
2123
import org.apache.iceberg.Schema;
@@ -655,7 +657,8 @@ private Dataset<Row> randomDataDF(Schema schema, int numRows) {
655657
Iterable<InternalRow> rows = RandomData.generateSpark(schema, numRows, 0);
656658
JavaRDD<InternalRow> rowRDD = sparkContext.parallelize(Lists.newArrayList(rows));
657659
StructType rowSparkType = SparkSchemaUtil.convert(schema);
658-
return spark.internalCreateDataFrame(JavaRDD.toRDD(rowRDD), rowSparkType, false);
660+
return IcebergTestShims.internalCreateDataFrame(
661+
spark, JavaRDD.toRDD(rowRDD), rowSparkType, false);
659662
}
660663

661664
private void append(String table, Dataset<Row> df) throws NoSuchTableException {

0 commit comments

Comments
 (0)