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

Commit 000ddf4

Browse files
committed
Merge branch 'Neuw84-master'
2 parents 79cf1bb + 98d5b3a commit 000ddf4

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

src/main/scala/com/audienceproject/spark/dynamodb/rdd/DynamoRelation.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ private[dynamodb] class DynamoRelation(userSchema: StructType, parameters: Map[S
107107
}).toSeq
108108
StructType(mapFields)
109109
case _: java.lang.Boolean => BooleanType
110+
case _: Array[Byte] => BinaryType
110111
case _ => StringType
111112
}
112113

src/main/scala/com/audienceproject/spark/dynamodb/rdd/TypeConversion.scala

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ private[dynamodb] object TypeConversion {
3737
case LongType => nullableGet(_.getLong)(attrName)
3838
case DoubleType => nullableGet(_.getDouble)(attrName)
3939
case FloatType => nullableGet(_.getFloat)(attrName)
40+
case BinaryType => nullableGet(_.getBinary)(attrName)
4041
case DecimalType() => nullableGet(_.getNumber)(attrName)
4142
case ArrayType(innerType, _) =>
4243
nullableGet(_.getList)(attrName).andThen(extractArray(convertValue(innerType)))
@@ -72,6 +73,10 @@ private[dynamodb] object TypeConversion {
7273
case string: String => string
7374
case _ => null
7475
}
76+
case BinaryType => {
77+
case byteArray: Array[Byte] => byteArray
78+
case _ => null
79+
}
7580
case _ => throw new IllegalArgumentException(s"Spark DataType '${sparkType.typeName}' could not be mapped to a corresponding DynamoDB data type.")
7681
}
7782

0 commit comments

Comments
 (0)