Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions dev/mvn-build-helper/assembly/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -120,10 +120,6 @@
<exclude>org.apache.arrow.c.**</exclude>
</excludes>
</relocation>
<relocation>
<pattern>io.netty</pattern>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This io.netty relocation was added in #1597 to fix NoClassDefFoundError: io/netty/buffer/Unpooled under shaded-spark — that change bundled netty-buffer/netty-common into the assembly and relocated them so they wouldn't clash. This PR removes the relocation but keeps those bundled deps (pom.xml:48-55), so netty ships at its original io.netty.* coordinates again, which is the state #1597 fixed away. Does dropping it reopen that shaded-spark conflict? Since the relocation only affects the shaded assembly — not the unit tests or the Hive Parquet path here — it'd help to know what in this PR needs it gone, along with the arrow-memory-netty exclusions added to the shims pom.xml.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This io.netty relocation was added in #1597 to fix NoClassDefFoundError: io/netty/buffer/Unpooled under shaded-spark — that change bundled netty-buffer/netty-common into the assembly and relocated them so they wouldn't clash. This PR removes the relocation but keeps those bundled deps (pom.xml:48-55), so netty ships at its original io.netty.* coordinates again, which is the state #1597 fixed away. Does dropping it reopen that shaded-spark conflict? Since the relocation only affects the shaded assembly — not the unit tests or the Hive Parquet path here — it'd help to know what in this PR needs it gone, along with the arrow-memory-netty exclusions added to the shims pom.xml.

@weiqingy wei Thank you very much for the code review. I've been a bit busy these past couple of days, but I will complete the revisions as soon as possible. Thank you again for reviewing the code.

<shadedPattern>${auron.shade.packageName}.io.netty</shadedPattern>
</relocation>
<relocation>
<pattern>javax.annotation</pattern>
<shadedPattern>${auron.shade.packageName}.javax.annotation</shadedPattern>
Expand Down
33 changes: 33 additions & 0 deletions spark-extension-shims-spark/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,27 @@
<artifactId>spark-core_${scalaVersion}</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.spark</groupId>
<artifactId>spark-catalyst_${scalaVersion}</artifactId>
<scope>provided</scope>
<exclusions>
<exclusion>
<groupId>org.apache.arrow</groupId>
<artifactId>arrow-memory-netty</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.spark</groupId>
<artifactId>spark-hive_${scalaVersion}</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-client-api</artifactId>
<version>${hadoopVersion}</version>
</dependency>
<dependency>
<groupId>org.apache.spark</groupId>
<artifactId>spark-sql_${scalaVersion}</artifactId>
Expand Down Expand Up @@ -103,15 +119,32 @@
<artifactId>spark-core_${scalaVersion}</artifactId>
<type>test-jar</type>
</dependency>
<dependency>
<groupId>org.apache.arrow</groupId>
<artifactId>arrow-memory-core</artifactId>
<version>${arrowVersion}</version>
</dependency>
<dependency>
<groupId>org.apache.spark</groupId>
<artifactId>spark-catalyst_${scalaVersion}</artifactId>
<type>test-jar</type>
<exclusions>
<exclusion>
<groupId>org.apache.arrow</groupId>
<artifactId>arrow-memory-netty</artifactId>
</exclusion>
</exclusions>

</dependency>
<dependency>
<groupId>org.apache.spark</groupId>
<artifactId>spark-sql_${scalaVersion}</artifactId>
<type>test-jar</type>
</dependency>
<dependency>
<groupId>org.apache.spark</groupId>
<artifactId>spark-hive_${scalaVersion}</artifactId>
<type>test-jar</type>
</dependency>
</dependencies>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#
# 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.
#

org.apache.spark.sql.hive.execution.auron.plan.HiveConvertProvider
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
/*
* 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.spark.sql.hive.execution.auron.plan

import org.apache.spark.internal.Logging
import org.apache.spark.sql.auron.{AuronConverters, AuronConvertProvider}
import org.apache.spark.sql.auron.AuronConverters.getBooleanConf
import org.apache.spark.sql.execution.SparkPlan
import org.apache.spark.sql.hive.client.HiveClientImpl
import org.apache.spark.sql.hive.execution.HiveTableScanExec

class HiveConvertProvider extends AuronConvertProvider with Logging {
override def isEnabled: Boolean =

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AuronConvertProvider declares isEnabled(exec: SparkPlan): Boolean, and the dispatcher calls it with the plan (AuronConverters.scala:216 and :307). This override drops the parameter, so it doesn't implement the trait method — the abstract isEnabled(SparkPlan) stays unimplemented and override matches nothing, which the compiler rejects. That looks like the CI break flagged above. PaimonConvertProvider keeps the parameter and branches inside — would matching that signature work here?

override def isEnabled(exec: SparkPlan): Boolean =
  getBooleanConf("spark.auron.enable.hiveTable", defaultValue = true)

getBooleanConf("spark.auron.enable.hiveTable", defaultValue = true)

private def enableHiveTableScanExec: Boolean =
getBooleanConf("spark.auron.enable.parquetHiveTableScanExec", defaultValue = false)

override def isSupported(exec: SparkPlan): Boolean =

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

isSupported returns true for any table whose provider is hive, but convert only builds a native plan when isParquetTable holds and otherwise returns exec unchanged (line 49). So a non-Parquet Hive table (ORC, text) with both flags on would be reported as supported and then handed back un-converted, instead of falling through to the normal conversion path. Would gating isSupported on isParquetTable too keep the two in lockstep?

exec match {
case e: HiveTableScanExec
if enableHiveTableScanExec &&
e.relation.tableMeta.provider.isDefined &&
e.relation.tableMeta.provider.get.equals("hive") =>
true
case _ => false
}

override def convert(exec: SparkPlan): SparkPlan = {
exec match {
case hiveExec: HiveTableScanExec
if enableHiveTableScanExec
&& HiveTableUtil.isParquetTable(hiveExec) =>
convertParquetHiveTableScanExec(hiveExec)
case _ => exec
}
}

private def convertParquetHiveTableScanExec(hiveExec: HiveTableScanExec): SparkPlan = {
AuronConverters.addRenameColumnsExec(NativeParquetHiveTableScanExec(hiveExec))
}
}

object HiveTableUtil {
private val parquetFormat = "MapredParquetInputFormat"

def isParquetTable(basedHiveScan: HiveTableScanExec): Boolean = {
if (HiveClientImpl
.toHiveTable(basedHiveScan.relation.tableMeta)
.getInputFormatClass
.getSimpleName
.equalsIgnoreCase(parquetFormat)) {
true
} else {
false
}
}

}
Loading
Loading