Skip to content

Commit

Permalink
Merge pull request #38 from mjakubowski84/docu-streams
Browse files Browse the repository at this point in the history
Docu streams
  • Loading branch information
mjakubowski84 authored Jan 4, 2019
2 parents 1385e2c + ed9a1d6 commit 594d54f
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ jobs:
workflows:
version: 2

trying-stage:
build-and-release:
jobs:
- build
- release:
Expand Down
31 changes: 30 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Based on official Parquet library, Hadoop Client and Shapeless.
Add the library to your dependencies:

```
"com.github.mjakubowski84" %% "parquet4s" % "0.1.0"
"com.github.mjakubowski84" %% "parquet4s-core" % "0.2.0"
```

Expand Down Expand Up @@ -73,3 +73,32 @@ parquetIterable.foreach(println)
parquetIterable.close()

```

# How to use Parquet4S with Akka Streams?

Parquet4S has a simple integration module that allows you to read Parquet file using Akka Streams!
Just import it:

```
"com.github.mjakubowski84" %% "parquet4s-akka" % "0.2.0"
```

And now you can define Akka Streams source that reads Parquet files:

```scala
import com.github.mjakubowski84.parquet4s.ParquetStreams
import com.github.mjakubowski84.parquet4s.ParquetRecordDecoder._
import akka.actor.ActorSystem
import akka.stream.{ActorMaterializer, Materializer}

case class User(userId: String, name: String, created: java.sql.Timestamp)

implicit val system: AcrtorSystem = ActorSystem()
implicit val materializer: Materializer = ActorMaterializer()

ParquetStreams.fromParquet[User]("file:///data/users").runForeach(println)

system.terminate()

```
4 changes: 2 additions & 2 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ lazy val resolvers = Seq(

lazy val commonSettings = Seq(
Keys.organization := "com.github.mjakubowski84",
Keys.version := "0.2.0-SNAPSHOT",
Keys.isSnapshot := true,
Keys.version := "0.2.0",
Keys.isSnapshot := false,
Keys.scalaVersion := "2.11.12",
Keys.crossScalaVersions := Seq("2.11.12", "2.12.8"),
Keys.scalacOptions ++= Seq("-deprecation", "-target:jvm-1.8"),
Expand Down

0 comments on commit 594d54f

Please sign in to comment.