Skip to content

Commit

Permalink
Update indexed document test.
Browse files Browse the repository at this point in the history
  • Loading branch information
nicktobey committed Jan 9, 2025
1 parent 94bcde0 commit 5429156
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions go/store/prolly/tree/json_indexed_document_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -460,12 +460,15 @@ func TestJsonCompare(t *testing.T) {
func TestIndexedJsonDocument_CreateLargeStringValues(t *testing.T) {
ctx := sql.NewEmptyContext()
ns := NewTestNodeStore()
doc := make(map[string]interface{})
docMap := make(map[string]interface{})
value := strings.Repeat("x", 2097152)
doc["key"] = value
indexedDoc := newIndexedJsonDocumentFromValue(t, ctx, ns, doc)

lookup, err := indexedDoc.Lookup(ctx, "$.key")
docMap["key"] = value
doc, _, err := types.JSON.Convert(docMap)
require.NoError(t, err)
root, err := SerializeJsonToAddr(ctx, ns, doc.(sql.JSONWrapper))
require.NoError(t, err)
indexedDoc, err := NewJSONDoc(root.HashOf(), ns).ToIndexedJSONDocument(ctx)
lookup, err := types.LookupJSONValue(indexedDoc, "$.key")
require.NoError(t, err)
extractedValue, _, err := types.LongText.Convert(lookup)
require.NoError(t, err)
Expand Down

0 comments on commit 5429156

Please sign in to comment.