Search code examples
jsonapache-sparkspark-jobserver

In Spark JobServer. How to pass a json formated string on the input.string?


Im trying to execute the following curl command to run a job:

curl -k --basic --user 'user:psw' -d 'input.string= {"user":13}' 'https://localhost:8090/jobs?appName=test&classPath=test.ImportCSVFiles&context=import&sync=true'

But I get the following error:

 "com.typesafe.config.ConfigException$WrongType: String: 1: input.string has type OBJECT rather than STRING"

My idea is to pass more than one parameter like an sql query. A json format to easy handling on my submitted jar.

I'm on the right way or there is another way?


Solution

  • Copying it from comment.

    Issue was json was trying to read it not as string but as object directly because of string starting with braces "{".

    Correct input 'input.string= \"{\"user\":13}\" '