Skip to content
This repository was archived by the owner on Aug 31, 2021. It is now read-only.

Commit 0b53d78

Browse files
authored
Merge pull request #7 from tmwong2003/tmwong2003/fix-readme-call-to-read
Fixed README to correct call to spark.read.dynamodb
2 parents ceb9cb1 + c706ed7 commit 0b53d78

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1+
/target/
2+
/bin/
13
*.class
24
*.log
5+
.classpath
36
.idea
4-
target/
57
.wercker

README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ import com.audienceproject.spark.dynamodb.implicits._
2020
// Load a DataFrame from a Dynamo table. Only incurs the cost of a single scan for schema inference.
2121
val dynamoDf = spark.read.dynamodb("SomeTableName") // <-- DataFrame of Row objects with inferred schema.
2222

23-
2423
// Scan the table for the first 100 items (the order is arbitrary) and print them.
2524
dynamoDf.show(100)
2625

@@ -34,7 +33,7 @@ case class Vegetable (name: String, color: String, @attribute("weight_kg") weigh
3433
// Load a Dataset[Vegetable]. Notice the @attribute annotation on the case class - we imagine the weight attribute is named with an underscore in DynamoDB.
3534
import org.apache.spark.sql.functions._
3635
import spark.implicits._
37-
val vegetableDs = spark.dynamodbAs[Vegetable]("VegeTable")
36+
val vegetableDs = spark.read.dynamodbAs[Vegetable]("VegeTable")
3837
val avgWeightByColor = vegetableDs.agg($"color", avg($"weightKg")) // The column is called 'weightKg' in the Dataset.
3938

4039

project/plugins.sbt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
logLevel := Level.Warn
22

3-
addSbtPlugin("com.jsuereth" % "sbt-pgp" % "1.1.1")
3+
addSbtPlugin("com.jsuereth" % "sbt-pgp" % "1.1.1")
4+
addSbtPlugin("com.typesafe.sbteclipse" % "sbteclipse-plugin" % "5.2.4")

0 commit comments

Comments
 (0)