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

chengpan pushed a commit to branch branch-1.8
in repository https://gitbox.apache.org/repos/asf/kyuubi.git


The following commit(s) were added to refs/heads/branch-1.8 by this push:
     new 61754d327 [KYUUBI #6708] spark-sql-engine's classes should not be 
visible in server module
61754d327 is described below

commit 61754d32704a27f0a67a1b4d5d9011c46264de9a
Author: Cheng Pan <[email protected]>
AuthorDate: Mon Sep 23 17:46:15 2024 +0800

    [KYUUBI #6708] spark-sql-engine's classes should not be visible in server 
module
    
    # :mag: Description
    ## Issue References ๐Ÿ”—
    
    The server module does not consume the `spark-sql-engine` classes, but it 
supposes that
    `spark-sql-engine`'s jar existed on the target folder, so here we declare 
it as a dependency
    to make sure that Maven always processes `spark-sql-engine` module before 
the server module.
    IntelliJ IDEA 2024.1 fixed the IDEA-93855, thus the relocated classes 
inside the
    `spark-sql-engine`'s shaded jar are visible in the server module in IDEA, 
for example,
    `org.apache.kyuubi.shaded.spark.connect.proto.ExecutePlanRequest`, which 
silently breaks
    the IDEA code analysis and jumping capabilities.
    
    ## Describe Your Solution ๐Ÿ”ง
    
    Changing the dependency type from `jar`(default value) to `pom` seems to be 
a workaround.
    
    ## Types of changes :bookmark:
    
    - [x] Bugfix (non-breaking change which fixes an issue)
    - [ ] New feature (non-breaking change which adds functionality)
    - [ ] Breaking change (fix or feature that would cause existing 
functionality to change)
    
    ## Test Plan ๐Ÿงช
    
    <img width="593" alt="image" 
src="https://github.com/user-attachments/assets/cc53709a-5f9d-4452-a24f-0c84e2342191";>
    
    #### Behavior Without This Pull Request :coffin:
    
    <img width="1511" alt="image" 
src="https://github.com/user-attachments/assets/1c547c6d-a603-4c9d-92b4-8e2059b35fac";>
    
    #### Behavior With This Pull Request :tada:
    
    <img width="1509" alt="image" 
src="https://github.com/user-attachments/assets/55f9e6e5-b9ea-4959-9142-ab7db21ab9b1";>
    
    ---
    
    # Checklist ๐Ÿ“
    
    - [x] This patch was not authored or co-authored using [Generative 
Tooling](https://www.apache.org/legal/generative-tooling.html)
    
    **Be nice. Be informative.**
    
    Closes #6708 from pan3793/IDEA-93855.
    
    Closes #6708
    
    a73fd4235 [Cheng Pan] fix
    e4a8d36e7 [Cheng Pan] nit
    8c58d2ddc [Cheng Pan] IDEA-93855
    
    Authored-by: Cheng Pan <[email protected]>
    Signed-off-by: Cheng Pan <[email protected]>
    (cherry picked from commit 1d35cf2ced7e3392a96e90fa718c417bfe007522)
    Signed-off-by: Cheng Pan <[email protected]>
---
 kyuubi-server/pom.xml | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/kyuubi-server/pom.xml b/kyuubi-server/pom.xml
index 7885cf908..56e8d4127 100644
--- a/kyuubi-server/pom.xml
+++ b/kyuubi-server/pom.xml
@@ -317,10 +317,21 @@
             <scope>test</scope>
         </dependency>
 
+        <!--
+          The server module does not consume the `spark-sql-engine` classes, 
but it supposes that
+          `spark-sql-engine`'s jar existed on the target folder, so here we 
declare it as a dependency
+          to make sure that Maven always processes `spark-sql-engine` module 
before the server module.
+          IntelliJ IDEA 2024.1 fixed the IDEA-93855, thus the relocated 
classes inside the
+          `spark-sql-engine`'s shaded jar are visible in the server module in 
IDEA, for example,
+          `org.apache.kyuubi.shaded.spark.connect.proto.ExecutePlanRequest`, 
which silently breaks
+          the IDEA code analysis and jumping capabilities. It seems to be a 
workaround by changing
+          the dependency type from `jar`(default value) to `pom`.
+         -->
         <dependency>
             <groupId>org.apache.kyuubi</groupId>
             
<artifactId>kyuubi-spark-sql-engine_${scala.binary.version}</artifactId>
             <version>${project.version}</version>
+            <type>pom</type>
             <scope>test</scope>
             <exclusions>
                 <exclusion>

Reply via email to