Detected Guava issue #1635 which indicates that a version of Guava less than 16.01 is in use

前端 未结 6 570
野性不改
野性不改 2021-01-18 10:07

I am running spark job on emr and using datastax connector to connect to cassandra cluster. I am facing issues with the guava jar please find the details as below I am using

6条回答
  •  粉色の甜心
    2021-01-18 10:22

    I've had the same problem, and resolved it by using the maven Shade plugin to shade the guava version that the Cassandra connector brings in.

    I needed to exclude the Optional, Present and Absent classes explicitly because I was running into issues with Spark trying to cast from the non-shaded Guava Present type to the shaded Optional type. I'm not sure if this will cause any problems later on, but it seems to be working for me for now.

    You can add this to the section in your pom.xml:

    
        org.apache.maven.plugins
        maven-shade-plugin
        2.4.3
        
            
                package
                
                    
                        shade
                    
                
            
        
    
        
            true
            true
            fat
    
            
                
                    com.google
                    shaded.guava
                    
                        com.google.**
                    
    
                    
                        com.google.common.base.Optional
                        com.google.common.base.Absent
                        com.google.common.base.Present
                    
                
            
    
            
                
                    *:*
                    
                        META-INF/*.SF
                        META-INF/*.DSA
                        META-INF/*.RSA
                    
                
            
    
        
    
    

提交回复
热议问题