Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
64 commits
Select commit Hold shift + click to select a range
674d2ee
WIP
suddendust Sep 22, 2025
f6cb67a
Revert "WIP"
suddendust Sep 22, 2025
6e7795d
Reapply "WIP"
suddendust Sep 22, 2025
957a897
Revert "Reapply "WIP""
suddendust Sep 22, 2025
502c373
Reapply "Reapply "WIP""
suddendust Sep 22, 2025
0544358
WIP
suddendust Sep 22, 2025
82dc37f
WIP
suddendust Sep 22, 2025
c0ed72a
Add default impl for `getDocumentType`
suddendust Sep 22, 2025
e9f25da
WIP
suddendust Sep 22, 2025
e6be8b9
Merge branch 'pg_subdocument' of github.com:suddendust/document-store…
suddendust Sep 22, 2025
ee7678f
Rollback unnecessary changes
suddendust Sep 22, 2025
63b0dec
Added default DocumentType in Document.java
suddendust Sep 22, 2025
7f91cf0
Address comments
suddendust Sep 23, 2025
7376b56
Merge branch 'main' into pg_subdocument
suddendust Sep 24, 2025
ea2aefd
Address comments
suddendust Sep 24, 2025
e3ccb5b
Merge remote-tracking branch 'myfork/pg_subdocument' into pg_subdocument
suddendust Sep 24, 2025
3e3e6cf
Address docs
suddendust Sep 24, 2025
e6a6f7e
Adds more test cases in JSONDocumentTest.java
suddendust Sep 24, 2025
483eb16
Spotless
suddendust Sep 24, 2025
e5926ea
Added more test cases
suddendust Sep 24, 2025
b261463
Spotless
suddendust Sep 24, 2025
7cf8e17
Add test case for PostgresResultIteratorWithBasicTypes
suddendust Sep 24, 2025
9c474db
Merge branch 'main' into pg_subdocument
suddendust Sep 24, 2025
cb2ed18
WIP
suddendust Sep 24, 2025
06fdc8f
Merge branch 'pg_subdocument' into poc
suddendust Sep 24, 2025
fbce388
WIP
suddendust Sep 24, 2025
50b09b7
Merge branch 'main' of github.com:hypertrace/document-store into refa…
suddendust Sep 24, 2025
0f8df71
WIP
suddendust Sep 24, 2025
7f7defe
WIP
suddendust Sep 24, 2025
13e591e
Added test cases
suddendust Sep 26, 2025
e1074b9
Added 1 more integration test case to ensure result consistency b/w f…
suddendust Sep 26, 2025
77e1473
Added test cases for unnest
suddendust Sep 26, 2025
70763bb
Merge branch 'main' into refactor
suddendust Oct 2, 2025
7f76f74
Address comments except integration test
suddendust Oct 2, 2025
40946ad
Revert "Address comments except integration test"
suddendust Oct 2, 2025
41a405f
Merge branch 'refactor' of github.com:suddendust/document-store into …
suddendust Oct 2, 2025
1962554
Reapply "Address comments except integration test"
suddendust Oct 2, 2025
1903a4a
WIP
suddendust Oct 2, 2025
c3d0a32
Test cases working
suddendust Oct 2, 2025
0fa2a62
WIP
suddendust Oct 2, 2025
b6a4cf6
WIP
suddendust Oct 2, 2025
d2fef95
Add more test cases
suddendust Oct 2, 2025
de09a90
Add more test cases
suddendust Oct 2, 2025
4f5e40d
WIP
suddendust Oct 2, 2025
444b171
Unnest working for flat collections
suddendust Oct 6, 2025
7557fb0
WIP
suddendust Oct 6, 2025
88c8708
Merge branch 'main' of github.com:hypertrace/document-store into refa…
suddendust Oct 6, 2025
5eda1b8
WIP
suddendust Oct 6, 2025
4f8aafd
WIP
suddendust Oct 6, 2025
702b30e
WIP
suddendust Oct 6, 2025
7a6b799
WIP
suddendust Oct 6, 2025
a42d48b
WIP
suddendust Oct 6, 2025
2d016a3
Added test docs
suddendust Oct 8, 2025
36f2892
Separate flat and nested visitors
suddendust Oct 8, 2025
d4afa05
Revert "Separate flat and nested visitors"
suddendust Oct 9, 2025
b10a9a6
Fix compilation issue
suddendust Oct 12, 2025
d28bd87
Added more test cases
suddendust Oct 12, 2025
8279987
Fix failing test case
suddendust Oct 12, 2025
16172f4
Test case to cover missed lines
suddendust Oct 13, 2025
93af3f1
Test case to cover missed lines
suddendust Oct 13, 2025
b1a75c1
Added additional test cases
suddendust Oct 13, 2025
92742b3
Add todo
suddendust Oct 13, 2025
1a0c33f
Merge branch 'main' into flat_collection_unnest
suddendust Oct 14, 2025
e209d88
Merge branch 'main' into flat_collection_unnest
suddendust Oct 15, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[
{
"item": "Soap",
"price": 10
},
{
"item": "Soap",
"price": 20
},
{
"item": "Soap",
"price": 10
}
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[
{
"item": "Soap",
"price": 10
},
{
"item": "Shampoo",
"price": 5
}
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[
{
"item": "Shampoo",
"price": 5
}
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[
{
"item": "Mirror",
"price": 20
}
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
[
{
"avg_price": "13.3333333333333333",
"tag_count": 3,
"tags": "hygiene"
},
{
"avg_price": "7.5000000000000000",
"tag_count": 2,
"tags": "premium"
},
{
"avg_price": "7.5000000000000000",
"tag_count": 2,
"tags": "personal-care"
},
{
"avg_price": "8.0000000000000000",
"tag_count": 2,
"tags": "grooming"
},
{
"avg_price": "7.5000000000000000",
"tag_count": 2,
"tags": "budget"
},
{
"avg_price": "6.5000000000000000",
"tag_count": 2,
"tags": "bulk"
},
{
"avg_price": "5.0000000000000000",
"tag_count": 2,
"tags": "hair-care"
}
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[
{
"count": 25
}
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
[
{
"item": "Mirror",
"tags": "home-decor"
},
{
"item": "Mirror",
"tags": "reflective"
},
{
"item": "Mirror",
"tags": "glass"
},
{
"item": "Soap",
"tags": "hygiene"
},
{
"item": "Soap",
"tags": "antibacterial"
},
{
"item": "Soap",
"tags": "family-pack"
}
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[
{
"item": "Soap",
"tags": "premium"
},
{
"item": "Shampoo",
"tags": "premium"
}
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[
{
"count": 27
}
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
[
{
"tags": "hygiene",
"count": 3
},
{
"tags": "personal-care",
"count": 2
},
{
"tags": "premium",
"count": 2
},
{
"tags": "home-decor",
"count": 1
},
{
"tags": "reflective",
"count": 1
},
{
"tags": "glass",
"count": 1
},
{
"tags": "hair-care",
"count": 2
},
{
"tags": "herbal",
"count": 1
},
{
"tags": "budget",
"count": 2
},
{
"tags": "bulk",
"count": 2
},
{
"tags": "antibacterial",
"count": 1
},
{
"tags": "family-pack",
"count": 1
},
{
"tags": "grooming",
"count": 2
},
{
"tags": "plastic",
"count": 1
},
{
"tags": "essential",
"count": 1
},
{
"tags": "wholesale",
"count": 1
},
{
"tags": "basic",
"count": 1
}
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[
{
"item": "Comb",
"tags": "grooming"
},
{
"item": "Comb",
"tags": "grooming"
}
]
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
{
"statements": [
"INSERT INTO \"myTestFlat\" (\n\"_id\", \"item\", \"price\", \"quantity\", \"date\", \"tags\", \"props\", \"sales\"\n) VALUES (\n1, 'Soap', 10, 2, '2014-03-01T08:00:00Z',\n'{\"hygiene\", \"personal-care\", \"premium\"}',\n'{\"colors\": [\"Blue\", \"Green\"], \"brand\": \"Dettol\", \"size\": \"M\", \"seller\": {\"name\": \"Metro Chemicals Pvt. Ltd.\", \"address\": {\"city\": \"Mumbai\", \"pincode\": 400004}}}',\nNULL\n)",
"INSERT INTO \"myTestFlat\" (\n\"_id\", \"item\", \"price\", \"quantity\", \"date\", \"tags\", \"props\", \"sales\"\n) VALUES (\n2, 'Mirror', 20, 1, '2014-03-01T09:00:00Z',\n'{\"home-decor\", \"reflective\", \"glass\"}',\nNULL,\nNULL\n)",
"INSERT INTO \"myTestFlat\" (\n\"_id\", \"item\", \"price\", \"quantity\", \"date\", \"tags\", \"props\", \"sales\"\n) VALUES (\n3, 'Shampoo', 5, 10, '2014-03-15T09:00:00Z',\n'{\"hair-care\", \"personal-care\", \"premium\", \"herbal\"}',\n'{\"colors\": [\"Black\"], \"brand\": \"Sunsilk\", \"size\": \"L\", \"seller\": {\"name\": \"Metro Chemicals Pvt. Ltd.\", \"address\": {\"city\": \"Mumbai\", \"pincode\": 400004}}}',\nNULL\n)",
"INSERT INTO \"myTestFlat\" (\n\"_id\", \"item\", \"price\", \"quantity\", \"date\", \"tags\", \"props\", \"sales\"\n) VALUES (\n4, 'Shampoo', 5, 20, '2014-04-04T11:21:39.736Z',\n'{\"hair-care\", \"budget\", \"bulk\"}',\nNULL,\nNULL\n)",
"INSERT INTO \"myTestFlat\" (\n\"_id\", \"item\", \"price\", \"quantity\", \"date\", \"tags\", \"props\", \"sales\"\n) VALUES (\n5, 'Soap', 20, 5, '2014-04-04T21:23:13.331Z',\n'{\"hygiene\", \"antibacterial\", \"family-pack\"}',\n'{\"colors\": [\"Orange\", \"Blue\"], \"brand\": \"Lifebuoy\", \"size\": \"S\", \"seller\": {\"name\": \"Hans and Co.\", \"address\": {\"city\": \"Kolkata\", \"pincode\": 700007}}}',\nNULL\n)",
"INSERT INTO \"myTestFlat\" (\n\"_id\", \"item\", \"price\", \"quantity\", \"date\", \"tags\", \"props\", \"sales\"\n) VALUES (\n6, 'Comb', 7.5, 5, '2015-06-04T05:08:13Z',\n'{\"grooming\", \"plastic\", \"essential\"}',\nNULL,\nNULL\n)",
"INSERT INTO \"myTestFlat\" (\n\"_id\", \"item\", \"price\", \"quantity\", \"date\", \"tags\", \"props\", \"sales\"\n) VALUES (\n7, 'Comb', 7.5, 10, '2015-09-10T08:43:00Z',\n'{\"grooming\", \"bulk\", \"wholesale\"}',\n'{\"colors\": [], \"seller\": {\"name\": \"Go Go Plastics\", \"address\": {\"city\": \"Kolkata\", \"pincode\": 700007}}}',\nNULL\n)",
"INSERT INTO \"myTestFlat\" (\n\"_id\", \"item\", \"price\", \"quantity\", \"date\", \"tags\", \"props\", \"sales\"\n) VALUES (\n8, 'Soap', 10, 5, '2016-02-06T20:20:13Z',\n'{\"hygiene\", \"budget\", \"basic\"}',\nNULL,\nNULL\n)"
"INSERT INTO \"myTestFlat\" (\n\"_id\", \"item\", \"price\", \"quantity\", \"date\", \"tags\", \"props\", \"sales\", \"numbers\", \"scores\", \"flags\"\n) VALUES (\n1, 'Soap', 10, 2, '2014-03-01T08:00:00Z',\n'{\"hygiene\", \"personal-care\", \"premium\"}',\n'{\"colors\": [\"Blue\", \"Green\"], \"brand\": \"Dettol\", \"size\": \"M\", \"seller\": {\"name\": \"Metro Chemicals Pvt. Ltd.\", \"address\": {\"city\": \"Mumbai\", \"pincode\": 400004}}}',\nNULL,\n'{1, 2, 3}',\n'{4.5, 9.2}',\n'{true, false}'\n)",
"INSERT INTO \"myTestFlat\" (\n\"_id\", \"item\", \"price\", \"quantity\", \"date\", \"tags\", \"props\", \"sales\", \"numbers\", \"scores\", \"flags\"\n) VALUES (\n2, 'Mirror', 20, 1, '2014-03-01T09:00:00Z',\n'{\"home-decor\", \"reflective\", \"glass\"}',\nNULL,\nNULL,\n'{10, 20}',\nNULL,\nNULL\n)",
"INSERT INTO \"myTestFlat\" (\n\"_id\", \"item\", \"price\", \"quantity\", \"date\", \"tags\", \"props\", \"sales\", \"numbers\", \"scores\", \"flags\"\n) VALUES (\n3, 'Shampoo', 5, 10, '2014-03-15T09:00:00Z',\n'{\"hair-care\", \"personal-care\", \"premium\", \"herbal\"}',\n'{\"colors\": [\"Black\"], \"brand\": \"Sunsilk\", \"size\": \"L\", \"seller\": {\"name\": \"Metro Chemicals Pvt. Ltd.\", \"address\": {\"city\": \"Mumbai\", \"pincode\": 400004}}}',\nNULL,\nNULL,\n'{3.14, 2.71}',\nNULL\n)",
"INSERT INTO \"myTestFlat\" (\n\"_id\", \"item\", \"price\", \"quantity\", \"date\", \"tags\", \"props\", \"sales\", \"numbers\", \"scores\", \"flags\"\n) VALUES (\n4, 'Shampoo', 5, 20, '2014-04-04T11:21:39.736Z',\n'{\"hair-care\", \"budget\", \"bulk\"}',\nNULL,\nNULL,\nNULL,\nNULL,\n'{true, true}'\n)",
"INSERT INTO \"myTestFlat\" (\n\"_id\", \"item\", \"price\", \"quantity\", \"date\", \"tags\", \"props\", \"sales\", \"numbers\", \"scores\", \"flags\"\n) VALUES (\n5, 'Soap', 20, 5, '2014-04-04T21:23:13.331Z',\n'{\"hygiene\", \"antibacterial\", \"family-pack\"}',\n'{\"colors\": [\"Orange\", \"Blue\"], \"brand\": \"Lifebuoy\", \"size\": \"S\", \"seller\": {\"name\": \"Hans and Co.\", \"address\": {\"city\": \"Kolkata\", \"pincode\": 700007}}}',\nNULL,\nNULL,\nNULL,\nNULL\n)",
"INSERT INTO \"myTestFlat\" (\n\"_id\", \"item\", \"price\", \"quantity\", \"date\", \"tags\", \"props\", \"sales\", \"numbers\", \"scores\", \"flags\"\n) VALUES (\n6, 'Comb', 7.5, 5, '2015-06-04T05:08:13Z',\n'{\"grooming\", \"plastic\", \"essential\"}',\nNULL,\nNULL,\nNULL,\nNULL,\nNULL\n)",
"INSERT INTO \"myTestFlat\" (\n\"_id\", \"item\", \"price\", \"quantity\", \"date\", \"tags\", \"props\", \"sales\", \"numbers\", \"scores\", \"flags\"\n) VALUES (\n7, 'Comb', 7.5, 10, '2015-09-10T08:43:00Z',\n'{\"grooming\", \"bulk\", \"wholesale\"}',\n'{\"colors\": [], \"seller\": {\"name\": \"Go Go Plastics\", \"address\": {\"city\": \"Kolkata\", \"pincode\": 700007}}}',\nNULL,\nNULL,\nNULL,\nNULL\n)",
"INSERT INTO \"myTestFlat\" (\n\"_id\", \"item\", \"price\", \"quantity\", \"date\", \"tags\", \"props\", \"sales\", \"numbers\", \"scores\", \"flags\"\n) VALUES (\n8, 'Soap', 10, 5, '2016-02-06T20:20:13Z',\n'{\"hygiene\", \"budget\", \"basic\"}',\nNULL,\nNULL,\nNULL,\nNULL,\nNULL\n)",
"INSERT INTO \"myTestFlat\" (\n\"_id\", \"item\", \"price\", \"quantity\", \"date\", \"tags\", \"props\", \"sales\", \"numbers\", \"scores\", \"flags\"\n) VALUES (\n9, 'Bottle', 15, 3, '2016-03-01T10:00:00Z',\nNULL,\nNULL,\nNULL,\nNULL,\nNULL,\nNULL\n)",
"INSERT INTO \"myTestFlat\" (\n\"_id\", \"item\", \"price\", \"quantity\", \"date\", \"tags\", \"props\", \"sales\", \"numbers\", \"scores\", \"flags\"\n) VALUES (\n10, 'Cup', 8, 2, '2016-04-01T10:00:00Z',\n'{}',\nNULL,\nNULL,\nNULL,\nNULL,\nNULL\n)"
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,10 @@ public class FlatPostgresFieldTransformer implements PostgresColTransformer {

@Override
public FieldToPgColumn transform(String orgFieldName, Map<String, String> pgColMapping) {
// In flat structure mode, all fields are direct PostgreSQL columns as-is
return new FieldToPgColumn(null, PostgresUtils.wrapFieldNamesWithDoubleQuotes(orgFieldName));
// Check if this field has been unnested (e.g., "tags" -> "tags_unnested")
String pgColumnName = pgColMapping.getOrDefault(orgFieldName, orgFieldName);
// In flat structure mode, all fields are direct PostgreSQL columns
return new FieldToPgColumn(null, PostgresUtils.wrapFieldNamesWithDoubleQuotes(pgColumnName));
}

@Override
Expand Down
Loading
Loading