0
object SBX_WorldPerm {

def main(args:Array[String]){ 

val conf = new SparkConf()
val sc = new SparkContext(conf)
val sqlcontext = new org.apache.spark.sql.SQLContext(sc)
var perm : String = null
var h_loc : String = null 

val SBXParquetFile = sqlcontext.parquetFile(args(0))
val SBXParquetFile_rdd = SBXParquetFile.rdd.map(fields => (fields(0),fields(3))).collect()
for((permission,hdfs_loc) <- SBXParquetFile_rdd){
  perm = permission
  h_loc = hdfs_loc
  if(h_loc.startsWith("/sbx/"))
    if(perm.endsWith("rwx"))
        println(h_loc)
   }
 }
}

i slightly modified my code but still no luck, i am getting this error

<console>:70: error: type mismatch;
found   : Any
required: String
         perm = permission
                ^
<console>:71: error: type mismatch;
found   : Any
required: String
         h_loc = hdfs_loc

i am very much new to scala and any help would be appreciated. i looked into suggested answers but could not relate the problem to mine. thanks in advance

Tanveer
  • 1
  • 4
  • It's not 100% clear what you're asking. Please take a look at the formatting guidelines to see how you can make your code and errors a lot easier for everyone to read. For example, the ` key changes things to code, `like this`. – Mike Zavarello May 24 '16 at 17:18
  • I am very much new to scala and i went thru the other answer mentioned by zero323 but i couldn't understand the error, can you please help me to get identify my error and solve it – Tanveer May 24 '16 at 17:29
  • Error is simple `Row.apply` is of type `Int => Any`. `Any` is not a `String`. – zero323 May 24 '16 at 19:29

0 Answers0