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

xenon.relocated.io.grpc.StatusRuntimeException: INTERNAL: Unable to parse request #154

Closed
camper42 opened this issue Jul 12, 2022 · 6 comments

Comments

@camper42
Copy link
Contributor

error log:

Caused by: org.apache.spark.SparkException: Job aborted due to stage failure: Task 0 in stage 1.0 failed 4 times, most recent failure: Lost task 0.3 in stage 1.0 (TID 4) (10.113.41.152 executor 2): xenon.relocated.io.grpc.StatusRuntimeException: INTERNAL:
 Unable to parse request
        at xenon.relocated.io.grpc.stub.ClientCalls.toStatusRuntimeException(ClientCalls.java:271)
        at xenon.relocated.io.grpc.stub.ClientCalls.getUnchecked(ClientCalls.java:252)
        at xenon.relocated.io.grpc.stub.ClientCalls.blockingUnaryCall(ClientCalls.java:165)
        at xenon.protocol.grpc.ClickHouseGrpc$ClickHouseBlockingStub.executeQuery(ClickHouseGrpc.java:316)
        at xenon.clickhouse.grpc.GrpcNodeClient.executeQuery(GrpcNodeClient.scala:184)
        at xenon.clickhouse.grpc.GrpcNodeClient.syncInsert(GrpcNodeClient.scala:150)
        at xenon.clickhouse.grpc.GrpcNodeClient.syncInsertOutputJSONEachRow(GrpcNodeClient.scala:115)
        at xenon.clickhouse.write.ClickHouseWriter.$anonfun$flush$1(ClickHouseWriter.scala:159)
        at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:23)
        at scala.util.Try$.apply(Try.scala:213)
        at xenon.clickhouse.Utils$.retry(Utils.scala:83)
        at xenon.clickhouse.write.ClickHouseWriter.flush(ClickHouseWriter.scala:143)
        at xenon.clickhouse.write.ClickHouseWriter.commit(ClickHouseWriter.scala:96)
        at org.apache.spark.sql.execution.datasources.v2.DataWritingSparkTask$.$anonfun$run$1(WriteToDataSourceV2Exec.scala:430)
        at org.apache.spark.util.Utils$.tryWithSafeFinallyAndFailureCallbacks(Utils.scala:1496)
        at org.apache.spark.sql.execution.datasources.v2.DataWritingSparkTask$.run(WriteToDataSourceV2Exec.scala:457)
        at org.apache.spark.sql.execution.datasources.v2.V2TableWriteExec.$anonfun$writeWithV2$2(WriteToDataSourceV2Exec.scala:358)
        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:506)
        at org.apache.spark.util.Utils$.tryWithSafeFinally(Utils.scala:1462)
        at org.apache.spark.executor.Executor$TaskRunner.run(Executor.scala:509)
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
        at java.base/java.lang.Thread.run(Unknown Source)

reproduce:

  1. create table in clickhouse
create table dev.error (age Long, name String) ENGINE =  TinyLog();
  1. use latest snapshot
pyspark --repositories https://oss.sonatype.org/content/repositories/snapshots --packages com.github.housepower:clickhouse-spark-runtime-3.2_2.12:0.4.0-SNAPSHOT
❯ md5sum com.github.housepower_clickhouse-spark-runtime-3.2_2.12-0.4.0-SNAPSHOT.jar
26642b8172159b05a7d1748dc47e764c  com.github.housepower_clickhouse-spark-runtime-3.2_2.12-0.4.0-SNAPSHOT.jar
  1. write to clickhouse
df = spark.read.json("/usr/local/spark/examples/src/main/resources/people.json")
df.writeTo("`ck-1`.dev.error").append()

something wrong after #153

@pan3793
Copy link
Collaborator

pan3793 commented Jul 13, 2022

Try to reproduce, encounter an error on the "CREATE TABLE" statement, fixed by changing Long to Int64

clickhouse-s1r1 :) create table dev.error (age Long, name String) ENGINE = TinyLog();

CREATE TABLE dev.error
(
    `age` Long,
    `name` String
)
ENGINE = TinyLog

Query id: 72f485c7-4978-4384-80ab-4c719d780229


0 rows in set. Elapsed: 0.030 sec.

Received exception from server (version 22.5.1):
Code: 50. DB::Exception: Received from localhost:9000. DB::Exception: Unknown data type family: Long. Maybe you meant: ['Ring']. (UNKNOWN_TYPE)

except to this one, everything goes well.
image

@camper42
Copy link
Contributor Author

seems related to clickhouse version

export CLICKHOUSE_IMAGE=clickhouse/clickhouse-server:21.8.12.29
./gradlew clean test --tests=ClickHouseSingleSuite

@camper42
Copy link
Contributor Author

camper42 commented Jul 14, 2022

query: "INSERT INTO `db_part_date`.`tbl_part_date` FORMAT JSONEachRow"
query_id: "409c1288-c470-4ea9-8592-364ffa67dd4a"
input_data: "\004\"M\030`ps\036\000\000\200{\"id\":11,\"date\":\"2022-04-11\"}\n\000\000\000\000"
output_format: "JSONEachRow"
user_name: "default"
input_compression_type: "lz4"

bad input_data ? lz4 compressed, not sure if it's correct

@camper42
Copy link
Contributor Author

maybe we should upgrade to spark-3.3
I know how painful to maintain multiple versions with insufficient dev = =

@pan3793
Copy link
Collaborator

pan3793 commented Jul 14, 2022

It may be caused by ClickHouse/ClickHouse#34408

Try set spark.clickhouse.write.compression.codec=none

@camper42
Copy link
Contributor Author

Try set spark.clickhouse.write.compression.codec=none

It works, thx

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

No branches or pull requests

2 participants