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)
}
}
}
我稍微修改了我的代码,但仍然没有运气,我收到此错误
<console>:70: error: type mismatch;
found : Any
required: String
perm = permission
^
<console>:71: error: type mismatch;
found : Any
required: String
h_loc = hdfs_loc
我对scala非常新,任何帮助都会受到赞赏。我查看了建议的答案,但无法将问题与我的问题联系起来。提前谢谢