Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] spark stream dataframe write to doris json parsing exeception #47

Closed
3 tasks done
chovy-3012 opened this issue Aug 24, 2022 · 0 comments · Fixed by #48
Closed
3 tasks done

[Bug] spark stream dataframe write to doris json parsing exeception #47

chovy-3012 opened this issue Aug 24, 2022 · 0 comments · Fixed by #48

Comments

@chovy-3012
Copy link
Contributor

chovy-3012 commented Aug 24, 2022

Search before asking

  • I had searched in the issues and found no similar issues.

Version

master

What's Wrong?

spark stream write to doris occurs the follwing exception:

com.fasterxml.jackson.core.JsonParseException: Unexpected character ('-' (code 45)): Expected space separating root-level values
 at [Source: (String)"2022-08-23 12:09:22.706"; line: 1, column: 6]
	at com.fasterxml.jackson.core.JsonParser._constructError(JsonParser.java:1840)
	at com.fasterxml.jackson.core.base.ParserMinimalBase._reportError(ParserMinimalBase.java:712)
	at com.fasterxml.jackson.core.base.ParserMinimalBase._reportUnexpectedChar(ParserMinimalBase.java:637)
	at com.fasterxml.jackson.core.base.ParserMinimalBase._reportMissingRootWS(ParserMinimalBase.java:684)
	at com.fasterxml.jackson.core.json.ReaderBasedJsonParser._verifyRootSpace(ReaderBasedJsonParser.java:1678)
	at com.fasterxml.jackson.core.json.ReaderBasedJsonParser._parsePosNumber(ReaderBasedJsonParser.java:1321)
	at com.fasterxml.jackson.core.json.ReaderBasedJsonParser.nextToken(ReaderBasedJsonParser.java:769)
	at com.fasterxml.jackson.databind.ObjectMapper._readTreeAndClose(ObjectMapper.java:4231)
	at com.fasterxml.jackson.databind.ObjectMapper.readTree(ObjectMapper.java:2711)
	at org.apache.doris.spark.sql.DorisStreamLoadSink.$anonfun$write$3(DorisStreamLoadSink.scala:58)
	at org.apache.doris.spark.sql.DorisStreamLoadSink.$anonfun$write$3$adapted(DorisStreamLoadSink.scala:56)
	at scala.collection.immutable.Range.foreach(Range.scala:156)
	at org.apache.doris.spark.sql.DorisStreamLoadSink.$anonfun$write$2(DorisStreamLoadSink.scala:56)
	at org.apache.doris.spark.sql.DorisStreamLoadSink.$anonfun$write$2$adapted(DorisStreamLoadSink.scala:54)
	at scala.collection.Iterator.foreach(Iterator.scala:944)
	at scala.collection.Iterator.foreach$(Iterator.scala:944)
	at org.apache.spark.sql.execution.WholeStageCodegenExec$$anon$1.foreach(WholeStageCodegenExec.scala:753)
	at org.apache.doris.spark.sql.DorisStreamLoadSink.$anonfun$write$1(DorisStreamLoadSink.scala:54)
	at org.apache.doris.spark.sql.DorisStreamLoadSink.$anonfun$write$1$adapted(DorisStreamLoadSink.scala:51)
	at org.apache.spark.rdd.RDD.$anonfun$foreachPartition$2(RDD.scala:1020)
	at org.apache.spark.rdd.RDD.$anonfun$foreachPartition$2$adapted(RDD.scala:1020)
	at org.apache.spark.SparkContext.$anonfun$runJob$5(SparkContext.scala:2236)
	at org.apache.spark.scheduler.ResultTask.runTask(ResultTask.scala:90)
	at org.apache.spark.scheduler.Task.run(Task.scala:131)
	at org.apache.spark.executor.Executor$TaskRunner.$anonfun$run$3(Executor.scala:497)
	at org.apache.spark.util.Utils$.tryWithSafeFinally(Utils.scala:1439)
	at org.apache.spark.executor.Executor$TaskRunner.run(Executor.scala:500)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:748)

What You Expected?

doris-spark-connector can write stream dataframe to doris

How to Reproduce?

eg:

    df.selectExpr("CAST(timestamp AS STRING)", "CAST(partition as INT)")
      .writeStream
      .format("doris")
      .option("checkpointLocation", "/tmp/test")
      .option("doris.table.identifier", dorisTable)
      .option("doris.fenodes", dorisFeNodes)
      .option("user", dorisUser)
      .option("password", dorisPwd)
      .start().awaitTermination()
    spark.stop()

Anything Else?

No response

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Code of Conduct

@chovy-3012 chovy-3012 reopened this Aug 24, 2022
@chovy-3012 chovy-3012 changed the title [Bug] [Bug] spark stream dataframe write to doris json parsing exeception Aug 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant