-
Notifications
You must be signed in to change notification settings - Fork 293
feat: Add experimental support for Apache Spark 3.5.1 #587
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
5463731
44188de
b29d326
c93897c
8c729ab
929c383
57ee6c1
0f28434
732faed
33b5597
9a66671
76a331f
b822c71
96f3e85
ae23ac8
dfb8800
007fbf5
712ea70
788ee5e
079c013
4f43e32
b28f875
10ecc03
a6821b1
d7f43fe
36fd25a
a4db7ac
15bcb0b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| /* | ||
| * Licensed to the Apache Software Foundation (ASF) under one | ||
| * or more contributor license agreements. See the NOTICE file | ||
| * distributed with this work for additional information | ||
| * regarding copyright ownership. The ASF licenses this file | ||
| * to you under the Apache License, Version 2.0 (the | ||
| * "License"); you may not use this file except in compliance | ||
| * with the License. You may obtain a copy of the License at | ||
| * | ||
| * http://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, | ||
| * software distributed under the License is distributed on an | ||
| * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
| * KIND, either express or implied. See the License for the | ||
| * specific language governing permissions and limitations | ||
| * under the License. | ||
| */ | ||
|
|
||
| package org.apache.comet.shims | ||
|
|
||
| import org.apache.spark.paths.SparkPath | ||
| import org.apache.spark.sql.catalyst.InternalRow | ||
| import org.apache.spark.sql.execution.datasources.PartitionedFile | ||
|
|
||
| object ShimBatchReader { | ||
|
|
||
| def newPartitionedFile(partitionValues: InternalRow, file: String): PartitionedFile = | ||
| PartitionedFile( | ||
| partitionValues, | ||
| SparkPath.fromPathString(file), | ||
| -1, // -1 means we read the entire file | ||
| -1, | ||
| Array.empty[String], | ||
| 0, | ||
| 0) | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| /* | ||
| * Licensed to the Apache Software Foundation (ASF) under one | ||
| * or more contributor license agreements. See the NOTICE file | ||
| * distributed with this work for additional information | ||
| * regarding copyright ownership. The ASF licenses this file | ||
| * to you under the Apache License, Version 2.0 (the | ||
| * "License"); you may not use this file except in compliance | ||
| * with the License. You may obtain a copy of the License at | ||
| * | ||
| * http://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, | ||
| * software distributed under the License is distributed on an | ||
| * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
| * KIND, either express or implied. See the License for the | ||
| * specific language governing permissions and limitations | ||
| * under the License. | ||
| */ | ||
|
|
||
| package org.apache.comet.shims | ||
|
|
||
| import org.apache.spark.paths.SparkPath | ||
| import org.apache.spark.sql.catalyst.InternalRow | ||
| import org.apache.spark.sql.execution.datasources.PartitionedFile | ||
|
|
||
| object ShimBatchReader { | ||
|
|
||
| def newPartitionedFile(partitionValues: InternalRow, file: String): PartitionedFile = | ||
| PartitionedFile( | ||
| partitionValues, | ||
| SparkPath.fromPathString(file), | ||
| -1, // -1 means we read the entire file | ||
| -1, | ||
| Array.empty[String], | ||
| 0, | ||
| 0, | ||
| Map.empty) | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -91,8 +91,11 @@ under the License. | |
| <argLine>-ea -Xmx4g -Xss4m ${extraJavaTestArgs}</argLine> | ||
| <additional.3_3.test.source>spark-3.3-plus</additional.3_3.test.source> | ||
| <additional.3_4.test.source>spark-3.4-plus</additional.3_4.test.source> | ||
| <additional.3_5.test.source>not-needed</additional.3_5.test.source> | ||
| <additional.pre35.test.source>spark-pre-3.5</additional.pre35.test.source> | ||
| <shims.majorVerSrc>spark-3.x</shims.majorVerSrc> | ||
| <shims.minorVerSrc>spark-3.4</shims.minorVerSrc> | ||
| <shims.pre35Src>spark-pre-3.5</shims.pre35Src> | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Do you think we should reuse the existing properties instead introducing a new one? If so, I could help submit a pr to address that since this PR is already merged. |
||
| </properties> | ||
|
|
||
| <dependencyManagement> | ||
|
|
@@ -547,6 +550,21 @@ under the License. | |
| </properties> | ||
| </profile> | ||
|
|
||
| <profile> | ||
| <!-- FIXME: this is WIP. Tests may fail --> | ||
| <id>spark-3.5</id> | ||
| <properties> | ||
| <scala.version>2.12.18</scala.version> | ||
| <spark.version>3.5.1</spark.version> | ||
| <spark.version.short>3.5</spark.version.short> | ||
| <parquet.version>1.13.1</parquet.version> | ||
| <shims.minorVerSrc>spark-3.5</shims.minorVerSrc> | ||
| <shims.pre35Src>not-needed</shims.pre35Src> | ||
| <additional.pre35.test.source>not-needed</additional.pre35.test.source> | ||
| <additional.3_5.test.source>spark-3.5</additional.3_5.test.source> | ||
| </properties> | ||
| </profile> | ||
|
|
||
| <profile> | ||
| <!-- FIXME: this is WIP. Tests may fail https://github.com/apache/datafusion-comet/issues/551 --> | ||
| <id>spark-4.0</id> | ||
|
|
@@ -561,6 +579,8 @@ under the License. | |
| <slf4j.version>2.0.13</slf4j.version> | ||
| <shims.majorVerSrc>spark-4.0</shims.majorVerSrc> | ||
| <shims.minorVerSrc>not-needed-yet</shims.minorVerSrc> | ||
| <shims.pre35Src>not-needed</shims.pre35Src> | ||
| <additional.pre35.test.source>not-needed</additional.pre35.test.source> | ||
| <!-- Use jdk17 by default --> | ||
| <java.version>17</java.version> | ||
| <maven.compiler.source>${java.version}</maven.compiler.source> | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,52 @@ | ||
| /* | ||
| * Licensed to the Apache Software Foundation (ASF) under one | ||
| * or more contributor license agreements. See the NOTICE file | ||
| * distributed with this work for additional information | ||
| * regarding copyright ownership. The ASF licenses this file | ||
| * to you under the Apache License, Version 2.0 (the | ||
| * "License"); you may not use this file except in compliance | ||
| * with the License. You may obtain a copy of the License at | ||
| * | ||
| * http://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, | ||
| * software distributed under the License is distributed on an | ||
| * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
| * KIND, either express or implied. See the License for the | ||
| * specific language governing permissions and limitations | ||
| * under the License. | ||
| */ | ||
| package org.apache.comet.shims | ||
|
|
||
| import org.apache.comet.expressions.CometEvalMode | ||
| import org.apache.spark.sql.catalyst.expressions._ | ||
| import org.apache.spark.sql.types.{DataType, TimestampNTZType} | ||
|
|
||
| /** | ||
| * `CometExprShim` acts as a shim for for parsing expressions from different Spark versions. | ||
| */ | ||
| trait CometExprShim { | ||
| /** | ||
| * Returns a tuple of expressions for the `unhex` function. | ||
| */ | ||
| protected def unhexSerde(unhex: Unhex): (Expression, Expression) = { | ||
| (unhex.child, Literal(unhex.failOnError)) | ||
| } | ||
|
|
||
| protected def isTimestampNTZType(dt: DataType): Boolean = dt match { | ||
| case _: TimestampNTZType => true | ||
| case _ => false | ||
| } | ||
|
|
||
| protected def evalMode(c: Cast): CometEvalMode.Value = | ||
| CometEvalModeUtil.fromSparkEvalMode(c.evalMode) | ||
| } | ||
|
|
||
| object CometEvalModeUtil { | ||
| def fromSparkEvalMode(evalMode: EvalMode.Value): CometEvalMode.Value = evalMode match { | ||
| case EvalMode.LEGACY => CometEvalMode.LEGACY | ||
| case EvalMode.TRY => CometEvalMode.TRY | ||
| case EvalMode.ANSI => CometEvalMode.ANSI | ||
| } | ||
| } | ||
|
|
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| /* | ||
| * Licensed to the Apache Software Foundation (ASF) under one | ||
| * or more contributor license agreements. See the NOTICE file | ||
| * distributed with this work for additional information | ||
| * regarding copyright ownership. The ASF licenses this file | ||
| * to you under the Apache License, Version 2.0 (the | ||
| * "License"); you may not use this file except in compliance | ||
| * with the License. You may obtain a copy of the License at | ||
| * | ||
| * http://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, | ||
| * software distributed under the License is distributed on an | ||
| * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
| * KIND, either express or implied. See the License for the | ||
| * specific language governing permissions and limitations | ||
| * under the License. | ||
| */ | ||
|
|
||
| package org.apache.comet.shims | ||
|
|
||
| import org.apache.spark.sql.internal.LegacyBehaviorPolicy | ||
| import org.apache.spark.sql.internal.SQLConf | ||
|
|
||
| trait ShimSQLConf { | ||
|
|
||
| /** | ||
| * Spark 3.4 renamed parquetFilterPushDownStringStartWith to | ||
| * parquetFilterPushDownStringPredicate | ||
| */ | ||
| protected def getPushDownStringPredicate(sqlConf: SQLConf): Boolean = | ||
| sqlConf.parquetFilterPushDownStringPredicate | ||
|
|
||
| protected val LEGACY = LegacyBehaviorPolicy.LEGACY | ||
| protected val CORRECTED = LegacyBehaviorPolicy.CORRECTED | ||
| } |
Uh oh!
There was an error while loading. Please reload this page.