com.mongodb.spark.exceptions.MongoTypeConversionException: Cannot cast INT32 into a ConflictType (value: BsonInt32{value=171609012})

Stack Overflow | Youe | 4 months ago
  1. 0

    sparkR-Mongo connector query to subdocument

    Stack Overflow | 4 months ago | Youe
    com.mongodb.spark.exceptions.MongoTypeConversionException: Cannot cast INT32 into a ConflictType (value: BsonInt32{value=171609012})

    Root Cause Analysis

    1. com.mongodb.spark.exceptions.MongoTypeConversionException

      Cannot cast INT32 into a ConflictType (value: BsonInt32{value=171609012})

      at com.mongodb.spark.sql.MapFunctions$.com$mongodb$spark$sql$MapFunctions$$convertToDataType()
    2. com.mongodb.spark
      MapFunctions$$anonfun$3.apply
      1. com.mongodb.spark.sql.MapFunctions$.com$mongodb$spark$sql$MapFunctions$$convertToDataType(MapFunctions.scala:79)
      2. com.mongodb.spark.sql.MapFunctions$$anonfun$3.apply(MapFunctions.scala:38)
      3. com.mongodb.spark.sql.MapFunctions$$anonfun$3.apply(MapFunctions.scala:36)
      3 frames
    3. Scala
      ArrayOps$ofRef.map
      1. scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:244)
      2. scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:244)
      3. scala.collection.IndexedSeqOptimized$class.foreach(IndexedSeqOptimized.scala:33)
      4. scala.collection.mutable.ArrayOps$ofRef.foreach(ArrayOps.scala:108)
      5. scala.collection.TraversableLike$class.map(TraversableLike.scala:244)
      6. scala.collection.mutable.ArrayOps$ofRef.map(ArrayOps.scala:108)
      6 frames
    4. com.mongodb.spark
      MapFunctions$.com$mongodb$spark$sql$MapFunctions$$convertToDataType
      1. com.mongodb.spark.sql.MapFunctions$.documentToRow(MapFunctions.scala:36)
      2. com.mongodb.spark.sql.MapFunctions$.castToStructType(MapFunctions.scala:108)
      3. com.mongodb.spark.sql.MapFunctions$.com$mongodb$spark$sql$MapFunctions$$convertToDataType(MapFunctions.scala:74)
      3 frames