Skip to content

Instantly share code, notes, and snippets.

View nod's full-sized avatar
💻
i writes the codes, sometimes.

Jeremy Kelley nod

💻
i writes the codes, sometimes.
View GitHub Profile
Exception in thread "main" org.apache.spark.SparkException: Application application_1509398305238_0002 finished with failed status
at org.apache.spark.deploy.yarn.Client.run(Client.scala:1104)
at org.apache.spark.deploy.yarn.Client$.main(Client.scala:1150)
at org.apache.spark.deploy.yarn.Client.main(Client.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:755)
at org.apache.spark.deploy.SparkSubmit$.doRunMain$1(SparkSubmit.scala:180)
@nod
nod / gist:29a391f0eb4955d1ba3d34d12633fbbf
Last active November 7, 2017 17:23
For scala, using typesafe config, read default config and read runtime config if given via cmdline option
/*
Prior to this, I would build up `cfgMap` from my command line options.
If `'config` exists, that will load the run time config file and overlay it on top of the default config.
*/
// setup our default config
lazy val defaultConfig = ConfigFactory.parseResources("default.conf")
var conf = defaultConfig
// do we have a runtime config file?
val cfgFilePath = cfgMap.getOrElse('config, Nil)
>>> sample = {"a":2,"b":{"c":44}}
>>> sample.get("b",{}).get("c") # is gross
>>>
>>> class nestdict(dict):
... def __floordiv__(self, k):
... v = self.get(k)
... if isinstance(v, dict): return nestdict(v)
... return v
...
>>> z = nestdict(sample)