-
-
Notifications
You must be signed in to change notification settings - Fork 526
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
Add "dolt_optimize_json" system variable. #8722
Conversation
…ite Json documents to storage as simple blobs instead of path-indexed trees.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code looks good; I suggested two small updates from the sys var name change.
Looks like the new BATS test is failing in Lambda for some reason though.
integration-tests/bats/json.bats
Outdated
# This test inserts a large JSON document with the `dolt_dont_optimize_json` flag set. | ||
# We expect that the document gets stored as a blob. | ||
@test "json: Test dolt_dont_optimize_json system variable" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# This test inserts a large JSON document with the `dolt_dont_optimize_json` flag set. | |
# We expect that the document gets stored as a blob. | |
@test "json: Test dolt_dont_optimize_json system variable" { | |
# This test inserts a large JSON document with the `dolt_optimize_json` flag disabled. | |
# We expect that the document gets stored as a blob. | |
@test "json: Test dolt_optimize_json system variable disabled" { |
dontOptimizeJson, err := sqlCtx.Session.GetSessionVariable(sqlCtx, "dolt_optimize_json") | ||
if err != nil { | ||
return hash.Hash{}, err | ||
} | ||
if dontOptimizeJson == uint8(0) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dontOptimizeJson, err := sqlCtx.Session.GetSessionVariable(sqlCtx, "dolt_optimize_json") | |
if err != nil { | |
return hash.Hash{}, err | |
} | |
if dontOptimizeJson == uint8(0) { | |
optimizeJson, err := sqlCtx.Session.GetSessionVariable(sqlCtx, "dolt_optimize_json") | |
if err != nil { | |
return hash.Hash{}, err | |
} | |
if optimizeJson == uint8(0) { |
@nicktobey DOLT
|
…timize_json" to "dolt_optimize_json"
@nicktobey DOLT
|
When set to 0, Dolt will write Json documents to storage as simple blobs instead of path-indexed trees.
This is useful as a workaround to a current issue where the JSON chunker won't chunk in the middle of large string literals, resulting in larger-than-expected chunks.