title: Reading file from Google bucket in Spark
body: <p>I am trying to read file from google bucket though I am able to read it via spark-shell by including the gcs jar while going into spark shell. While submitting it via spark-submit it throws below error.</p>
  
  <pre><code>Exception in thread "main" java.lang.NoSuchMethodError: com.google.common.base.Splitter.splitToList(Ljava/lang/CharSequence;)Ljava/util/List;
          at com.google.cloud.hadoop.fs.gcs.GoogleHadoopFileSystemBase$ParentTimestampUpdateIncludePredicate.create(GoogleHadoopFileSystemBase.java:780)
          at com.google.cloud.hadoop.fs.gcs.GoogleHadoopFileSystemBase.createOptionsBuilderFromConfig(GoogleHadoopFileSystemBase.java:2130)
          at com.google.cloud.hadoop.fs.gcs.GoogleHadoopFileSystemBase.configure(GoogleHadoopFileSystemBase.java:1822)
          at com.google.cloud.hadoop.fs.gcs.GoogleHadoopFileSystemBase.initialize(GoogleHadoopFileSystemBase.java:1003)
          at com.google.cloud.hadoop.fs.gcs.GoogleHadoopFileSystemBase.initialize(GoogleHadoopFileSystemBase.java:966)
          at org.apache.hadoop.fs.FileSystem.createFileSystem(FileSystem.java:2689)
          at org.apache.hadoop.fs.FileSystem.access$200(FileSystem.java:94)
          at org.apache.hadoop.fs.FileSystem$Cache.getInternal(FileSystem.java:2723)
          at org.apache.hadoop.fs.FileSystem$Cache.get(FileSystem.java:2705)
          at org.apache.hadoop.fs.FileSystem.get(FileSystem.java:407)
          at org.apache.hadoop.fs.FileSystem.get(FileSystem.java:172)
          at org.apache.hadoop.mapred.JobConf.getWorkingDirectory(JobConf.java:656)
          at org.apache.hadoop.mapred.FileInputFormat.setInputPaths(FileInputFormat.java:440)
          at org.apache.hadoop.mapred.FileInputFormat.setInputPaths(FileInputFormat.java:413)
          at org.apache.spark.SparkContext$$anonfun$hadoopFile$1$$anonfun$33.apply(SparkContext.scala:1015)
          at org.apache.spark.SparkContext$$anonfun$hadoopFile$1$$anonfun$33.apply(SparkContext.scala:1015)
          at org.apache.spark.rdd.HadoopRDD$$anonfun$getJobConf$6.apply(HadoopRDD.scala:176)
          at org.apache.spark.rdd.HadoopRDD$$anonfun$getJobConf$6.apply(HadoopRDD.scala:176)
          at scala.Option.map(Option.scala:145)
          at org.apache.spark.rdd.HadoopRDD.getJobConf(HadoopRDD.scala:176)
          at org.apache.spark.rdd.HadoopRDD.getPartitions(HadoopRDD.scala:195)
          at org.apache.spark.rdd.RDD$$anonfun$partitions$2.apply(RDD.scala:239)
          at org.apache.spark.rdd.RDD$$anonfun$partitions$2.apply(RDD.scala:237)
          at scala.Option.getOrElse(Option.scala:120)
          at org.apache.spark.rdd.RDD.partitions(RDD.scala:237)
          at org.apache.spark.rdd.MapPartitionsRDD.getPartitions(MapPartitionsRDD.scala:35)
          at org.apache.spark.rdd.RDD$$anonfun$partitions$2.apply(RDD.scala:239)
          at org.apache.spark.rdd.RDD$$anonfun$partitions$2.apply(RDD.scala:237)
          at scala.Option.getOrElse(Option.scala:120)
          at org.apache.spark.rdd.RDD.partitions(RDD.scala:237)
          at org.apache.spark.SparkContext.runJob(SparkContext.scala:1929)
          at org.apache.spark.rdd.RDD.count(RDD.scala:1157)
          at com.google.reader.GoogleRead$.main(GoogleRead.scala:41)
          at com.google.reader.GoogleRead.main(GoogleRead.scala)
          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
          at java.lang.reflect.Method.invoke(Method.java:498)
          at org.apache.spark.deploy.SparkSubmit$.org$apache$spark$deploy$SparkSubmit$$runMain(SparkSubmit.scala:752)
          at org.apache.spark.deploy.SparkSubmit$.doRunMain$1(SparkSubmit.scala:181)
          at org.apache.spark.deploy.SparkSubmit$.submit(SparkSubmit.scala:206)
          at org.apache.spark.deploy.SparkSubmit$.main(SparkSubmit.scala:121)
          at org.apache.spark.deploy.SparkSubmit.main(SparkSubmit.scala)
  </code></pre>
  
  <p>I tried by excluding the guava dependency but still I am getting the above error. Below is the build.sbt file which I am using</p>
  
  <pre><code>import sbt.ExclusionRule
  name := "GoogleFileReader"
  
  version := "1.0"
  
  scalaVersion := "2.10.4"
  
  libraryDependencies += "org.apache.spark" % "spark-sql_2.10" % "1.6.1" exclude("com.google.guava", "guava")
  libraryDependencies += "com.google.cloud.bigdataoss" % "gcs-connector" % "1.6.0-hadoop2" 
  
  assemblyMergeStrategy in assembly := {
    case PathList("javax", "servlet", xs @ _*) =&gt; MergeStrategy.last
    case PathList("javax", "activation", xs @ _*) =&gt; MergeStrategy.last
    case PathList("org", "apache", xs @ _*) =&gt; MergeStrategy.last
    case PathList("com", "google", xs @ _*) =&gt; MergeStrategy.last
    case PathList("com", "esotericsoftware", xs @ _*) =&gt; MergeStrategy.last
    case PathList("com", "codahale", xs @ _*) =&gt; MergeStrategy.last
    case PathList("com", "yammer", xs @ _*) =&gt; MergeStrategy.last
    case "about.html" =&gt; MergeStrategy.rename
    case "META-INF/ECLIPSEF.RSA" =&gt; MergeStrategy.last
    case "META-INF/mailcap" =&gt; MergeStrategy.last
    case "META-INF/mimetypes.default" =&gt; MergeStrategy.last
    case "plugin.properties" =&gt; MergeStrategy.last
    case "log4j.properties" =&gt; MergeStrategy.last
    case "pom.properties" =&gt; MergeStrategy.last
    case x =&gt;
      val oldStrategy = (assemblyMergeStrategy in assembly).value
      oldStrategy(x)
  }
  </code></pre>