DmitryGrb commented on a change in pull request #97:
URL: https://github.com/apache/bahir/pull/97#discussion_r458670009



##########
File path: 
sql-streaming-sqs/src/main/scala/org/apache/spark/sql/streaming/sqs/SqsClient.scala
##########
@@ -131,13 +131,24 @@ class SqsClient(sourceOptions: SqsSourceOptions,
     }
   }
 
+  private def extractS3Message(parsedBody: JValue): JValue = {
+    implicit val formats = DefaultFormats
+    sourceOptions.messageWrapper match {
+      case sourceOptions.S3MessageWrapper.None => parsedBody
+      case sourceOptions.S3MessageWrapper.SNS => parse((parsedBody \ 
"Message").extract[String])

Review comment:
       Yes, it throws MappingException, however, error message was not 
descriptive enough:
   `org.json4s.package$MappingException: Did not find value which can be 
converted into java.lang.String`
   
   So I have updated the code to explicitly check for Message field in json and 
if it is not there throw Mapping exception with more details. Ideally we need 
our own exception here, however, I used org.json4s.MappingException since it is 
catch a few lines later anyways and not exposed anywhere. 




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to