Мой scala 12.12.6 код выглядит следующим образом:
res.forEach(elem=> {val matcher= pattern.matcher(elem.getValue.render().replace("\"",""))
query+=","+(if (matcher.matches()) "'"+matcher.group().replace("$","")+"'"+" as "+elem.getKey.replace("\"","`")
else elem.getValue.render().replace("\"","")+" as "+elem.getKey.replace("\"","`")
)})
//query= "select "+query.substring(1)+ " from final_table where dt='"+today+"'"
create_query= "select "+query.substring(1)+ s" from $final_table swv where swv.dt='$today'"+s" and swv.cveid IN ($create_query"
create_query="select "+query.substring(1)+" from default.secureworks_vulnerabilities where dt='2020-01-29'"
println("Create Query: "+create_query)
val df = spark.sql(create_query)
println("Number of rows selected: "+df.count())
if (df.count()>0) {
df.show()
val createJSON = CreateJSON
val masterJSON = new JSONObject()
val masterJSONArray = new JSONArray()
try {
df.collect().foreach(row => {
val fields = createJSON.generate(row)
masterJSONArray.put(fields)
})
}
catch {
case exp: SparkException => println("Exception raised :" + exp.getMessage)
System.exit(1)
}
Это работало несколько дней подряд go в искра 2,4; scala 2.11.12 Но теперь я вижу эту ошибку во время выполнения. Как мне этого избежать? Я собираю флягу с библиотекой scala -sdk-2.12 в Intellij
java.lang.NoSuchMethodError: scala.Predef$.refArrayOps([Ljava/lang/Object;)[Ljava/lang/Object;
at com.bofa.gis.App$.main(App.scala:81)
at com.bofa.gis.App.main(App.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.yarn.ApplicationMaster$$anon$2.run(ApplicationMaster.scala:673)
20/02/04 23:20:09 INFO yarn.ApplicationMaster: Final app status: FAILED, exitCode: 15, (reason: User class threw exception: java.lang.NoSuchMethodError: scala.Predef$.refArrayOps([Ljava/lang/Object;)[Ljava/lang/Object;
at com.bofa.gis.App$.main(App.scala:81)
at com.bofa.gis.App.main(App.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.yarn.ApplicationMaster$$anon$2.run(ApplicationMaster.scala:673)
)