-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Make json parsing more efficient on the JSON unfolding feature #34798
Comments
Please assign more memory to the JVM, this is not an issue with Metabase, but rather with massive JSON parsing that can’t fit into memory |
i couldn't find a table where the result set of the unfolding query would be more than 16MB so crashing with the 2GB it has now seems indicative of something pathological happening. but if that's not the case maybe for the purpose of this probing metabase should add some safety like "where pg_column_size(json_column) < 4096" |
@ericcj I wonder if you've ever identified the table causing the problem? I'm trying to reproduce this and I can't with any JSON file lying around. I even imported some 23mb file from the internets, but still no luck. I suspect that it fails when there are a lot of keys to surface as columns, but so far I've got around 100-smth columns (not much, yeah) and it's nothing. Not sure where to dig further. :) |
i didn't identify it. i disabled the 5 biggest tables by json column sizes but it still ran past 2GB: #34754 (comment) that size seems to indicate a problem with holding large values in memory since i doubt we have 2GB of keys. i suspect if you generate large random json data you could reproduce it, but placing some limits on the size of the json that's a candidate for analyzing might be an easier stopgap i'd be happy to upgrade and turn it back on with a limit |
I verified this is still a problem in 0.49.2 with Xmx1500m it hits the below timeout (after using its maximum heap size). It still occurs even after setting maxResultBuffer=25percent in the JDBC string so this must not be a single very large result. It's currently working with Xmx2g but obviously it's right on the line.
|
link to the message with a script to generate a (hopefully larger) json |
Describe the bug
Same problem as #34754 (comment) but I upgraded the instance type to have 4GB and set JAVA_OPTS=-Xmx2g and now it just takes longer to crash, pegging the CPU to 100% for 10m before crashing. Everything works fine without "Allow unfolding of JSON columns" and i can't figure out which table might be the problem since removing permissions for 5 that it seemed to have selected from last didn't fix the problem.
To Reproduce
Click "Sync database schema now"
Watch logs to see OutOfMemoryError
Expected behavior
No response
Logs
Severity
blocking unfolding of JSON columns
Additional context
No response
The text was updated successfully, but these errors were encountered: