This is an automated email from the ASF dual-hosted git repository.

philo pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-gluten.git


The following commit(s) were added to refs/heads/main by this push:
     new fc1a44910d [GLUTEN-10419][CORE] Fix type compatibility for 
HttpServletRequest through alias (#10420)
fc1a44910d is described below

commit fc1a44910d4b1f7ec9434f9444444af3ba8b0e78
Author: PHILO-HE <[email protected]>
AuthorDate: Wed Aug 13 16:03:23 2025 +0800

    [GLUTEN-10419][CORE] Fix type compatibility for HttpServletRequest through 
alias (#10420)
---
 gluten-ui/pom.xml                                  | 66 ++--------------------
 .../sql/execution/ui/GlutenAllExecutionsPage.scala |  3 +-
 .../apache/spark/sql/execution/ui/TypeAlias.scala  | 25 ++++++++
 .../apache/spark/sql/execution/ui/TypeAlias.scala  | 25 ++++++++
 .../apache/spark/sql/execution/ui/TypeAlias.scala  | 25 ++++++++
 .../apache/spark/sql/execution/ui/TypeAlias.scala  | 25 ++++++++
 .../apache/spark/sql/execution/ui/TypeAlias.scala  | 25 ++++++++
 7 files changed, 132 insertions(+), 62 deletions(-)

diff --git a/gluten-ui/pom.xml b/gluten-ui/pom.xml
index a3551876ec..74c2d23692 100644
--- a/gluten-ui/pom.xml
+++ b/gluten-ui/pom.xml
@@ -19,6 +19,12 @@
             <version>${project.version}</version>
             <scope>provided</scope>
         </dependency>
+        <dependency>
+            <groupId>org.apache.gluten</groupId>
+            <artifactId>${sparkshim.artifactId}</artifactId>
+            <version>${project.version}</version>
+            <scope>compile</scope>
+        </dependency>
         <dependency>
             <groupId>org.apache.spark</groupId>
             <artifactId>spark-sql_${scala.binary.version}</artifactId>
@@ -66,66 +72,6 @@
         </dependency>
     </dependencies>
 
-<profiles>
-    <profile>
-        <id>spark-4.0</id>
-        <build>
-            <plugins>
-                <plugin>
-                    <groupId>org.apache.maven.plugins</groupId>
-                    <artifactId>maven-antrun-plugin</artifactId>
-                    <executions>
-                        <execution>
-                            <phase>generate-sources</phase>
-                            <configuration>
-                                <target>
-                                    <replaceregexp 
file="src/main/scala/org/apache/spark/sql/execution/ui/GlutenAllExecutionsPage.scala"
-                                                   match="import javax.servlet"
-                                                   replace="import 
jakarta.servlet"
-                                                   byline="true"/>
-                                </target>
-                            </configuration>
-                            <goals>
-                                <goal>run</goal>
-                            </goals>
-                        </execution>
-                    </executions>
-                </plugin>
-            </plugins>
-        </build>
-    </profile>
-    <profile>
-        <id>!spark-4.0</id>
-        <activation>
-            <activeByDefault>true</activeByDefault>
-        </activation>
-        <build>
-            <plugins>
-                <plugin>
-                    <groupId>org.apache.maven.plugins</groupId>
-                    <artifactId>maven-antrun-plugin</artifactId>
-                    <executions>
-                        <execution>
-                            <phase>generate-sources</phase>
-                            <configuration>
-                                <target>
-                                    <replaceregexp 
file="src/main/scala/org/apache/spark/sql/execution/ui/GlutenAllExecutionsPage.scala"
-                                                   match="import 
jakarta.servlet"
-                                                   replace="import 
javax.servlet"
-                                                   byline="true"/>
-                                </target>
-                            </configuration>
-                            <goals>
-                                <goal>run</goal>
-                            </goals>
-                        </execution>
-                    </executions>
-                </plugin>
-            </plugins>
-        </build>
-    </profile>
-</profiles>
-
     <build>
         
<outputDirectory>target/scala-${scala.binary.version}/classes</outputDirectory>
         
<testOutputDirectory>target/scala-${scala.binary.version}/test-classes</testOutputDirectory>
diff --git 
a/gluten-ui/src/main/scala/org/apache/spark/sql/execution/ui/GlutenAllExecutionsPage.scala
 
b/gluten-ui/src/main/scala/org/apache/spark/sql/execution/ui/GlutenAllExecutionsPage.scala
index 3149829df4..af153e28c4 100644
--- 
a/gluten-ui/src/main/scala/org/apache/spark/sql/execution/ui/GlutenAllExecutionsPage.scala
+++ 
b/gluten-ui/src/main/scala/org/apache/spark/sql/execution/ui/GlutenAllExecutionsPage.scala
@@ -19,11 +19,10 @@ package org.apache.spark.sql.execution.ui
 import org.apache.spark.internal.Logging
 import org.apache.spark.sql.catalyst.util.StringUtils.PlanStringConcat
 import org.apache.spark.sql.errors.QueryExecutionErrors
+import org.apache.spark.sql.execution.ui.TypeAlias._
 import org.apache.spark.ui.{PagedDataSource, PagedTable, UIUtils, WebUIPage}
 import org.apache.spark.util.Utils
 
-import jakarta.servlet.http.HttpServletRequest
-
 import java.net.URLEncoder
 import java.nio.charset.StandardCharsets.UTF_8
 
diff --git 
a/shims/spark32/src/main/scala/org/apache/spark/sql/execution/ui/TypeAlias.scala
 
b/shims/spark32/src/main/scala/org/apache/spark/sql/execution/ui/TypeAlias.scala
new file mode 100644
index 0000000000..5abb70bed0
--- /dev/null
+++ 
b/shims/spark32/src/main/scala/org/apache/spark/sql/execution/ui/TypeAlias.scala
@@ -0,0 +1,25 @@
+/*
+ * 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.execution.ui
+
+/**
+ * Ensures compatibility for the type HttpServletRequest across Spark 4.0 and 
earlier versions.
+ * Starting from Spark 4.0, `jakarta.servlet.http.HttpServletRequest` is used.
+ */
+object TypeAlias {
+  type HttpServletRequest = javax.servlet.http.HttpServletRequest
+}
diff --git 
a/shims/spark33/src/main/scala/org/apache/spark/sql/execution/ui/TypeAlias.scala
 
b/shims/spark33/src/main/scala/org/apache/spark/sql/execution/ui/TypeAlias.scala
new file mode 100644
index 0000000000..5abb70bed0
--- /dev/null
+++ 
b/shims/spark33/src/main/scala/org/apache/spark/sql/execution/ui/TypeAlias.scala
@@ -0,0 +1,25 @@
+/*
+ * 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.execution.ui
+
+/**
+ * Ensures compatibility for the type HttpServletRequest across Spark 4.0 and 
earlier versions.
+ * Starting from Spark 4.0, `jakarta.servlet.http.HttpServletRequest` is used.
+ */
+object TypeAlias {
+  type HttpServletRequest = javax.servlet.http.HttpServletRequest
+}
diff --git 
a/shims/spark34/src/main/scala/org/apache/spark/sql/execution/ui/TypeAlias.scala
 
b/shims/spark34/src/main/scala/org/apache/spark/sql/execution/ui/TypeAlias.scala
new file mode 100644
index 0000000000..5abb70bed0
--- /dev/null
+++ 
b/shims/spark34/src/main/scala/org/apache/spark/sql/execution/ui/TypeAlias.scala
@@ -0,0 +1,25 @@
+/*
+ * 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.execution.ui
+
+/**
+ * Ensures compatibility for the type HttpServletRequest across Spark 4.0 and 
earlier versions.
+ * Starting from Spark 4.0, `jakarta.servlet.http.HttpServletRequest` is used.
+ */
+object TypeAlias {
+  type HttpServletRequest = javax.servlet.http.HttpServletRequest
+}
diff --git 
a/shims/spark35/src/main/scala/org/apache/spark/sql/execution/ui/TypeAlias.scala
 
b/shims/spark35/src/main/scala/org/apache/spark/sql/execution/ui/TypeAlias.scala
new file mode 100644
index 0000000000..5abb70bed0
--- /dev/null
+++ 
b/shims/spark35/src/main/scala/org/apache/spark/sql/execution/ui/TypeAlias.scala
@@ -0,0 +1,25 @@
+/*
+ * 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.execution.ui
+
+/**
+ * Ensures compatibility for the type HttpServletRequest across Spark 4.0 and 
earlier versions.
+ * Starting from Spark 4.0, `jakarta.servlet.http.HttpServletRequest` is used.
+ */
+object TypeAlias {
+  type HttpServletRequest = javax.servlet.http.HttpServletRequest
+}
diff --git 
a/shims/spark40/src/main/scala/org/apache/spark/sql/execution/ui/TypeAlias.scala
 
b/shims/spark40/src/main/scala/org/apache/spark/sql/execution/ui/TypeAlias.scala
new file mode 100644
index 0000000000..40c66590e0
--- /dev/null
+++ 
b/shims/spark40/src/main/scala/org/apache/spark/sql/execution/ui/TypeAlias.scala
@@ -0,0 +1,25 @@
+/*
+ * 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.execution.ui
+
+/**
+ * Ensures compatibility for the type HttpServletRequest across Spark 4.0 and 
earlier versions.
+ * Starting from Spark 4.0, `jakarta.servlet.http.HttpServletRequest` is used.
+ */
+object TypeAlias {
+  type HttpServletRequest = jakarta.servlet.http.HttpServletRequest
+}


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to