Live data from Hacker News

Introducing DataFrames in Spark for Large Scale Data Science

databricks.com

21–30 of 47 posts

Re: Introducing DataFrames in Spark for Large Scale Data Science

#21
post #14

I'm one of the authors of the blog post as well as this new API. Feel free to ask me anything.

Are DataFrames RDDs with a new DSL?

In a way yes. It is a little bit more than that because DataFrames internally are actually "logical plans". Before execution, they are optimized by an optimizer called Catalyst and turn into physical plans.

Re: Introducing DataFrames in Spark for Large Scale Data Science

#22
post #21

Earlier quoted context omitted.

Are DataFrames RDDs with a new DSL?

In a way yes. It is a little bit more than that because DataFrames internally are actually "logical plans". Before execution, they are optimized by an optimizer called Catalyst and turn into physical plans.

Normal RDDs won't benefit from this optimisation, only DataFrames? Is that because using this new DSL allows Spark to more precisely plan what needs to happen for DataFrames?

I guess this means DataFrames should be used all the time in the future, or will there still be a reason to use plain RDDs in the future?

You guys are doing great work !

Re: Introducing DataFrames in Spark for Large Scale Data Science

#23
post #21

Earlier quoted context omitted.

Are DataFrames RDDs with a new DSL?

In a way yes. It is a little bit more than that because DataFrames internally are actually "logical plans". Before execution, they are optimized by an optimizer called Catalyst and turn into physical plans.

[deleted]

Re: Introducing DataFrames in Spark for Large Scale Data Science

#24
A replica of this benchmark on my laptop running R has this running in about 1/4 second. Seems like a pretty trivial benchmark?

library(data.table)

x = data.table(a=sample(10,10e6,replace=TRUE),num=sample(100,10e6,replace=TRUE)) t1=proc.time(); x[,sum(num),by=a]; print(proc.time()-t1)

   user  system elapsed
  0.209   0.032   0.245

Re: Introducing DataFrames in Spark for Large Scale Data Science

#25
post #21

Earlier quoted context omitted.

In a way yes. It is a little bit more than that because DataFrames internally are actually "logical plans". Before execution, they are optimized by an optimizer called Catalyst and turn into physical plans.

Normal RDDs won't benefit from this optimisation, only DataFrames? Is that because using this new DSL allows Spark to more precisely plan what needs to happen for DataFrames? I guess this means DataFrames should be used all the time in the future, or will there still be a reason to use plain RDDs in the future? You guys are doing great work !

Indeed, DataFrames give Spark more semantic information about the data transformations, and thus can be better optimized. We envision this to become the primary API users use. You can still fall back to the vanilla RDD API (afterall DataFrame can be viewed as RDD[Row]) for stuff that is not expressible with DataFrames.

Re: Introducing DataFrames in Spark for Large Scale Data Science

#26
post #14

I'm one of the authors of the blog post as well as this new API. Feel free to ask me anything.

Have there been any changes to the in-memory columnar caching used by SchemaRDDs in 1.2? I noticed some problems with that, for example if a SchemaRDD with cols [1,2,3] on parquet files [X,Y,Z] is cached, and then I create a new one with a subset of the cols say [1,2] on the same files [X,Y,Z], the new SchemaRDDs physical plan would refer to the files on disk instead of an in memory columnar scan. I'm wondering if DataFrames handle this differently and implications for caching.

For some context - In our case, loading a reasonable set of data from HDFS can take upto 10-30 mins so keeping a cached copy of the most recent data with certain columns projected is important.

Re: Introducing DataFrames in Spark for Large Scale Data Science

#27

A replica of this benchmark on my laptop running R has this running in about 1/4 second. Seems like a pretty trivial benchmark? library(data.table) x = data.table(a=sample(10,10e6,replace=TRUE),num=sample(100,10e6,replace=TRUE)) t1=proc.time(); x[,sum(num),by=a]; print(proc.time()-t1) user system elapsed 0.209 0.032 0.245

The example was mostly a toy example. The power really comes when you get interactivity for small data and big data. Using this, you could scale up to TBs of data on a cluster and still get results relatively fast, which is not something you can do with R.

I don't expect at small scale to beat R yet. There are a few low-hanging fruits for single node performance. For example, even for single node data, we incur a "shuffle" to do data exchange in aggregations. This is done to ensure both single node program and distributed program go through the same code path, to catch bugs. If we want to optimize more for single node performance, we can get the optimizer to remove the shuffle operation in the middle, and just run the aggregations. Then this toy example will probably be done in the 100ms range.

Re: Introducing DataFrames in Spark for Large Scale Data Science

#28

Has anyone had some good experiences with Spark? I put several weeks in to moving our machine learning pipeline over to Spark only to find I kept hitting a race condition in their scheduler. After doing a bit of searching, it seems this is actually a known issue https://issues.apache.org/jira/browse/SPARK-4454 and there's been a fix on their github for a while: https://github.com/apache/spark/pull/3345 and yet in tha…

I've been successfully using Spark in production since 0.7, across three or four significantly different projects.

I don't think I could bring myself to ever write another Hadoop job.

Re: Introducing DataFrames in Spark for Large Scale Data Science

#29

Has anyone had some good experiences with Spark? I put several weeks in to moving our machine learning pipeline over to Spark only to find I kept hitting a race condition in their scheduler. After doing a bit of searching, it seems this is actually a known issue https://issues.apache.org/jira/browse/SPARK-4454 and there's been a fix on their github for a while: https://github.com/apache/spark/pull/3345 and yet in tha…

Spark is pretty fantastic from our perspective. People just think about it in terms of a faster Hadoop MR but it is so much more. The APIs and integration with external systems are so much easier and more intuitive to use.

It really is Hadoop 2.0.

Re: Introducing DataFrames in Spark for Large Scale Data Science

#30
post #8

Has anyone had some good experiences with Spark? I put several weeks in to moving our machine learning pipeline over to Spark only to find I kept hitting a race condition in their scheduler. After doing a bit of searching, it seems this is actually a known issue https://issues.apache.org/jira/browse/SPARK-4454 and there's been a fix on their github for a while: https://github.com/apache/spark/pull/3345 and yet in tha…

Spark is less mature than Hadoop, so you will run into issues like this. In my experience, advocating for the bug to get fixed often results in it getting fixed... on a several month timeline. This happened with Avro support in Python. I advocated for the patch and someone supplied it in the next version of Spark. Lemme tell you though... as someone that has use Hadoop for 5+ years... not waiting 5-10 minutes every t…

Seriously ./spark-shell is a godsend for development.

And I love the fact you can press Tab and get autocompletion of methods.

Post reply on HN