3 ms·
More like 3 tiers of support: Scala -- native API Java -- java wrappers for Scala API, slightly clunky but same implementation Python+R -- janky process invo
by jbooth 10y ago
More like 3 tiers of support:
Scala -- native API
Java -- java wrappers for Scala API, slightly clunky but same implementation
Python+R -- janky process involving forking a process and feeding strings back and forth between JVM and python/R via pipes
- nchammas 10y agoYou're right about Python and R having to pass data back and forth to the JVM for certain operations, but also keep in mind that native code still runs in the native interpreter. That means you have access to the full ecosystem of the native language. For example, if I want to convert an RDD of JSON strings into Python dictionaries: import json rdd_dict = rdd.map(lambda x: json.loads(x)) Same goes for any external Python libraries I install on the cluster and want to use in my Spark job. You can even run your Python code on PyPy [4]! For me, working in Python generally feels like a first class experience on Spark. There are areas -- like GraphX [0], certain niche features [1] -- where Scala is definitely easier to work with, but with time that is becoming less [2] and less [3] true thanks to the DataFrame API. [0] https://spark.apache.org/graphx/ https://spark.apache.org/graphx/ [1] http://stackoverflow.com/q/23995040/877069 http://stackoverflow.com/q/23995040/877069 [2] https://github.com/graphframes/graphframes https://github.com/graphframes/graphframes [3] http://stackoverflow.com/a/37150604/877069 http://stackoverflow.com/a/37150604/877069 [4] https://github.com/apache/spark/pull/2144 https://github.com/apache/spark/pull/2144
- twic 10y agoHas anyone tried running Jython on top of the native API? Would that make any sense?