Skip to content

Commit

Permalink
typelevel#385 - document chaing with and without using a thrush - wro…
Browse files Browse the repository at this point in the history
…ng example copied...
  • Loading branch information
chris-twiner committed Jun 14, 2023
1 parent 9e55b49 commit be58661
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions docs/FeatureOverview.md
Original file line number Diff line number Diff line change
Expand Up @@ -652,9 +652,9 @@ withCityInfo.select(
Joins, or any similar operation, may be chained using a thrush combinator removing the need for intermediate values. Instead of:

```scala mdoc
val withBedroomInfoInterim = aptTypedDs.join(citiInfoTypedDS).inner { aptTypedDs('city) === citiInfoTypedDS('name) }
val withBedroomInfoInterim = aptTypedDs.joinInner(citiInfoTypedDS)( aptTypedDs('city) === citiInfoTypedDS('name) )
val withBedroomInfo = withBedroomInfoInterim
.join(bedroomStats).left { withBedroomInfoInterim.col('_1).field('city) === bedroomStats('city)}
.joinLeft(bedroomStats)( withBedroomInfoInterim.col('_1).field('city) === bedroomStats('city) )

withBedroomInfo.show().run()
```
Expand All @@ -668,10 +668,10 @@ libraryDependencies += "org.typelevel" %% "mouse" % "1.2.1"
```scala mdoc
import mouse.all._

val withBedroomInfo = aptTypedDs.join(citiInfoTypedDS).inner { aptTypedDs('city) === citiInfoTypedDS('name) }
.thrush( interim => join(bedroomStats).left { interim.col('_1).field('city) === bedroomStats('city)} )
val withBedroomInfoChained = aptTypedDs.joinInner(citiInfoTypedDS)( aptTypedDs('city) === citiInfoTypedDS('name) )
.thrush( interim => .joinLeft(bedroomStats)( interim.col('_1).field('city) === bedroomStats('city) ) )

withBedroomInfo.show().run()
withBedroomInfoChained.show().run()
```


Expand Down

0 comments on commit be58661

Please sign in to comment.