You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
at java.lang.Thread.run(Thread.java:748)
18/07/16 18:33:26 ERROR DynamoDBRelation: Failed converting item to row: {"conversation_id":"WT00014703a5c53ec0338a7ceb9cddf16c","agents":{"full_name":"Princess Naquita","role":"agent_level_1","agent_id":14732,"manager":"None","location":"None","team_id":15,"department":"service","email":"[email protected]","team_name":"Team 1"}}
scala.MatchError: StructType(StructField(agent_id,LongType,true), StructField(department,StringType,true), StructField(email,StringType,true), StructField(full_name,StringType,true), StructField(location,StringType,true), StructField(manager,StringType,true), StructField(role,StringType,true), StructField(team_id,LongType,true), StructField(team_name,StringType,true)) (of class org.apache.spark.sql.types.StructType)
at com.github.traviscrawford.spark.dynamodb.ItemConverter$$anonfun$1.apply(ItemConverter.scala:30)
at com.github.traviscrawford.spark.dynamodb.ItemConverter$$anonfun$1.apply(ItemConverter.scala:20)
at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:234)
at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:234)
at scala.collection.Iterator$class.foreach(Iterator.scala:893)
at scala.collection.AbstractIterator.foreach(Iterator.scala:1336)
at scala.collection.IterableLike$class.foreach(IterableLike.scala:72)
at org.apache.spark.sql.types.StructType.foreach(StructType.scala:98)
at scala.collection.TraversableLike$class.map(TraversableLike.scala:234)
at org.apache.spark.sql.types.StructType.map(StructType.scala:98)
at com.github.traviscrawford.spark.dynamodb.ItemConverter$.toRow(ItemConverter.scala:20)
at com.github.traviscrawford.spark.dynamodb.DynamoDBRelation$$anonfun$scan$1$$anonfun$7.apply(DynamoDBRelation.scala:131)
The text was updated successfully, but these errors were encountered:
was getting the same issue, and figured out how to get a round this... not ideal but seems to do the trick. Need to do more testing, but this might result in two reads, in which you might need to do add a persist or cach to the rdd so when it does the inferSchema its not read it again.
import com.github.traviscrawford.spark.dynamodb._
val tablename = "foobar"
val region = "us-east-1"
val totalSegments = 8
val pageSize = 1000
val table = spark.read.option("inferSchema", "true").json(DynamoScanner(spark.sparkContext, tablename, totalSegments, pageSize, None, None, Some(region)).toDS)
Hello guys,
After have load my DynamoDB table using scala when I try to retrieve a row filtered in a specific value I'm getting an error.
the full record format is :
Error:
The text was updated successfully, but these errors were encountered: