mediative / sparrow Goto Github PK
View Code? Open in Web Editor NEWScala library for converting Spark rows to case classes
License: Apache License 2.0
Scala library for converting Spark rows to case classes
License: Apache License 2.0
Provide an example which covers a simple case but which still gives a good introduction on how to use sparrow. The example project can also serve as an integration test.
@schema
macro with @embedded
case classesIncrease use of the library in the Spark community.
Clearly identify the license of each source file.
Currently build artifacts are published to http://ypg-data.github.io/repo which is mostly a manual process. Configure the project to publish artifacts to bintray to make it easier to release new versions and use them in internal Mediative projects.
The way the DSL code is generated by createSchema
regarding the apply partially applied function, it prevent the possibility to have overloaded apply methods on the companion object of a case class where the macro is being used. There's a FIXME in the code related to this:
https://github.com/ypg-data/sparrow/blob/master/core/src/test/scala/com.mediative.sparrow/SchemaSpec.scala#L67
The solution is to replace the following style in the generated code:
implicit val schema = (
field[String]("name") and
field[Long]("count")
)(apply _)
By something of this style:
implicit val schema = (
field[String]("name") and
field[Long]("count")
)((name: String, count: Long) => apply(name, count))
The library currently offer the possibility of reading a Spark Row and convert it to a case class (or custom structure - but optimized for case classes). What's missing is going the other way around, from the case class to the Row, to be able to serialize case classes and load them back. A collateral product of this is likely be to produce a Spark StructType
for a case class.
When we have bidirectional conversion Row
<==> case class
, then we can use Parquet to take case of the Row
<==> Array[Byte]
part to get full serialization of case classes and get Spark's SQL support on that data.
parquet <-> binary
serialization layerDataTime
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.