[GH-ISSUE #662] stackoverflow error when query group with clickhouse #178

Closed
opened 2026-03-07 20:45:45 +03:00 by kerem · 7 comments
Owner

Originally created by @simsicon on GitHub (Feb 17, 2022).
Original GitHub issue: https://github.com/dbeaver/cloudbeaver/issues/662

When query group array numeric data in clickhouse, causing stackoverflow

My equivalent query is like

SELECT  bizdate, groupArray(last_px) as px_array
FROM table
GROUP BY bizdate

last_px is decimal type, and I can confirm datetime and str not causing the problem.

It seems #248 had the same problem.

log

2022-02-17 06:53:29.263 - /api/gql
--
2022-02-17 14:53:29 | java.lang.StackOverflowError
2022-02-17 14:53:29 | at com.google.gson.stream.JsonWriter.string(JsonWriter.java:565)
2022-02-17 14:53:29 | at com.google.gson.stream.JsonWriter.writeDeferredName(JsonWriter.java:401)
2022-02-17 14:53:29 | at com.google.gson.stream.JsonWriter.value(JsonWriter.java:526)
2022-02-17 14:53:29 | at com.google.gson.internal.bind.TypeAdapters$7.write(TypeAdapters.java:236)
2022-02-17 14:53:29 | at com.google.gson.internal.bind.TypeAdapters$7.write(TypeAdapters.java:221)
2022-02-17 14:53:29 | at com.google.gson.internal.bind.TypeAdapterRuntimeTypeWrapper.write(TypeAdapterRuntimeTypeWrapper.java:69)
2022-02-17 14:53:29 | at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$1.write(ReflectiveTypeAdapterFactory.java:127)
2022-02-17 14:53:29 | at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.write(ReflectiveTypeAdapterFactory.java:245)
2022-02-17 14:53:29 | at com.google.gson.internal.bind.TypeAdapterRuntimeTypeWrapper.write(TypeAdapterRuntimeTypeWrapper.java:69)
2022-02-17 14:53:29 | at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$1.write(ReflectiveTypeAdapterFactory.java:127)
2022-02-17 14:53:29 | at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.write(ReflectiveTypeAdapterFactory.java:245)


Originally created by @simsicon on GitHub (Feb 17, 2022). Original GitHub issue: https://github.com/dbeaver/cloudbeaver/issues/662 When query group array numeric data in clickhouse, causing stackoverflow My equivalent query is like ``` SELECT bizdate, groupArray(last_px) as px_array FROM table GROUP BY bizdate ``` last_px is decimal type, and I can confirm datetime and str not causing the problem. It seems #248 had the same problem. log ``` 2022-02-17 06:53:29.263 - /api/gql -- 2022-02-17 14:53:29 | java.lang.StackOverflowError 2022-02-17 14:53:29 | at com.google.gson.stream.JsonWriter.string(JsonWriter.java:565) 2022-02-17 14:53:29 | at com.google.gson.stream.JsonWriter.writeDeferredName(JsonWriter.java:401) 2022-02-17 14:53:29 | at com.google.gson.stream.JsonWriter.value(JsonWriter.java:526) 2022-02-17 14:53:29 | at com.google.gson.internal.bind.TypeAdapters$7.write(TypeAdapters.java:236) 2022-02-17 14:53:29 | at com.google.gson.internal.bind.TypeAdapters$7.write(TypeAdapters.java:221) 2022-02-17 14:53:29 | at com.google.gson.internal.bind.TypeAdapterRuntimeTypeWrapper.write(TypeAdapterRuntimeTypeWrapper.java:69) 2022-02-17 14:53:29 | at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$1.write(ReflectiveTypeAdapterFactory.java:127) 2022-02-17 14:53:29 | at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.write(ReflectiveTypeAdapterFactory.java:245) 2022-02-17 14:53:29 | at com.google.gson.internal.bind.TypeAdapterRuntimeTypeWrapper.write(TypeAdapterRuntimeTypeWrapper.java:69) 2022-02-17 14:53:29 | at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$1.write(ReflectiveTypeAdapterFactory.java:127) 2022-02-17 14:53:29 | at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.write(ReflectiveTypeAdapterFactory.java:245) ```
kerem 2026-03-07 20:45:45 +03:00
Author
Owner

@kseniiaguzeeva commented on GitHub (Feb 17, 2022):

Could you please give me an example of table DDL to reproduce the issue?

<!-- gh-comment-id:1042638923 --> @kseniiaguzeeva commented on GitHub (Feb 17, 2022): Could you please give me an example of table DDL to reproduce the issue?
Author
Owner

@simsicon commented on GitHub (Feb 18, 2022):

Could you please give me an example of table DDL to reproduce the issue?

Like this, thanks

CREATE TABLE  IF NOT EXISTS tick (
    trade_date UInt32,
    orig_time Int64,
    last_px Decimal(9, 3),
)
ENGINE = MergeTree()
PARTITION BY trade_date
ORDER BY orig_time
;
<!-- gh-comment-id:1043969227 --> @simsicon commented on GitHub (Feb 18, 2022): > Could you please give me an example of table DDL to reproduce the issue? Like this, thanks ``` CREATE TABLE IF NOT EXISTS tick ( trade_date UInt32, orig_time Int64, last_px Decimal(9, 3), ) ENGINE = MergeTree() PARTITION BY trade_date ORDER BY orig_time ; ```
Author
Owner

@kseniiaguzeeva commented on GitHub (Feb 21, 2022):

I have a similar issue, but the stackoverflow error is different. Could you please also tell me the Clickhouse version? It will help me to find out the problem.
Do other applications can display the result?

<!-- gh-comment-id:1046690774 --> @kseniiaguzeeva commented on GitHub (Feb 21, 2022): I have a similar issue, but the stackoverflow error is different. Could you please also tell me the Clickhouse version? It will help me to find out the problem. Do other applications can display the result?
Author
Owner

@simsicon commented on GitHub (Feb 22, 2022):

I have a similar issue, but the stackoverflow error is different. Could you please also tell me the Clickhouse version? It will help me to find out the problem.

I am using clickhouse 22.1.3.7.

Do other applications can display the result?

Sorry I have not tested it with other clients

<!-- gh-comment-id:1047428528 --> @simsicon commented on GitHub (Feb 22, 2022): > I have a similar issue, but the stackoverflow error is different. Could you please also tell me the Clickhouse version? It will help me to find out the problem. I am using clickhouse 22.1.3.7. >Do other applications can display the result? Sorry I have not tested it with other clients
Author
Owner

@kseniiaguzeeva commented on GitHub (Mar 23, 2022):

The issue is fixed in the latest release

<!-- gh-comment-id:1076000911 --> @kseniiaguzeeva commented on GitHub (Mar 23, 2022): The issue is fixed in the [latest release](https://github.com/dbeaver/cloudbeaver)
Author
Owner

@simsicon commented on GitHub (Apr 6, 2022):

The issue is fixed in the latest release

Thanks, I am just looking forward to the release, and it would be nice if it is coming soon.

<!-- gh-comment-id:1090045284 --> @simsicon commented on GitHub (Apr 6, 2022): > The issue is fixed in the [latest release](https://github.com/dbeaver/cloudbeaver) Thanks, I am just looking forward to the release, and it would be nice if it is coming soon.
Author
Owner

@kseniiaguzeeva commented on GitHub (Apr 6, 2022):

It's already published. You can upgrade your version.

<!-- gh-comment-id:1090058437 --> @kseniiaguzeeva commented on GitHub (Apr 6, 2022): It's already published. You can upgrade your version.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/cloudbeaver#178
No description provided.