Skip to content

Commit ca75883

Browse files
committed
WIP
1 parent 6bbf5b1 commit ca75883

File tree

5 files changed

+178
-89
lines changed

5 files changed

+178
-89
lines changed

document-store/src/integrationTest/java/org/hypertrace/core/documentstore/DocStoreQueryV1Test.java

Lines changed: 22 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,6 @@
9494
import org.hypertrace.core.documentstore.expression.impl.ConstantExpression;
9595
import org.hypertrace.core.documentstore.expression.impl.FunctionExpression;
9696
import org.hypertrace.core.documentstore.expression.impl.IdentifierExpression;
97-
import org.hypertrace.core.documentstore.expression.impl.JsonArrayIdentifierExpression;
9897
import org.hypertrace.core.documentstore.expression.impl.JsonFieldType;
9998
import org.hypertrace.core.documentstore.expression.impl.JsonIdentifierExpression;
10099
import org.hypertrace.core.documentstore.expression.impl.KeyExpression;
@@ -212,8 +211,7 @@ private static void createFlatCollectionSchema(
212211
+ "\"sales\" JSONB,"
213212
+ "\"numbers\" INTEGER[],"
214213
+ "\"scores\" DOUBLE PRECISION[],"
215-
+ "\"flags\" BOOLEAN[],"
216-
+ "\"attributes\" JSONB"
214+
+ "\"flags\" BOOLEAN[]"
217215
+ ");",
218216
collectionName);
219217

@@ -4690,14 +4688,14 @@ void testExistsFilterOnJsonArrays(String dataStoreName) throws JsonProcessingExc
46904688
datastore.getCollectionForType(FLAT_COLLECTION_NAME, DocumentType.FLAT);
46914689

46924690
// Query using EXISTS on JSONB array field
4693-
// attributes.certifications has: non-empty (row 1), empty (rows 2, 10, 11), NULL (rest)
4691+
// props.colors has: non-empty (rows 1, 3, 5), empty (row 7), NULL (rest)
46944692
Query query =
46954693
Query.builder()
46964694
.addSelection(IdentifierExpression.of("item"))
4697-
.addSelection(JsonIdentifierExpression.of("attributes", "certifications"))
4695+
.addSelection(JsonIdentifierExpression.of("props", "colors"))
46984696
.setFilter(
46994697
RelationalExpression.of(
4700-
JsonArrayIdentifierExpression.of("attributes", "certifications"),
4698+
JsonIdentifierExpression.of("props", JsonFieldType.STRING_ARRAY, "colors"),
47014699
EXISTS,
47024700
ConstantExpression.of("null")))
47034701
.build();
@@ -4710,18 +4708,18 @@ void testExistsFilterOnJsonArrays(String dataStoreName) throws JsonProcessingExc
47104708
JsonNode json = new ObjectMapper().readTree(doc.toJson());
47114709
count++;
47124710

4713-
// Verify that ALL returned documents have non-empty arrays in attributes.certifications
4714-
JsonNode attributes = json.get("attributes");
4715-
assertTrue(attributes.isObject(), "attributes should be a JSON object");
4711+
// Verify that ALL returned documents have non-empty arrays in props.colors
4712+
JsonNode props = json.get("props");
4713+
assertTrue(props.isObject(), "props should be a JSON object");
47164714

4717-
JsonNode certifications = attributes.get("certifications");
4715+
JsonNode colors = props.get("colors");
47184716
assertTrue(
4719-
certifications.isArray() && !certifications.isEmpty(),
4720-
"certifications should be non-empty array, but was: " + certifications);
4717+
colors.isArray() && !colors.isEmpty(),
4718+
"colors should be non-empty array, but was: " + colors);
47214719
}
47224720

4723-
// Should return only row 1 which has non-empty certifications array
4724-
assertEquals(1, count, "Should return exactly 1 document with non-empty certifications");
4721+
// Should return rows 1, 3, 5 which have non-empty colors arrays
4722+
assertEquals(3, count, "Should return exactly 3 documents with non-empty colors");
47254723
}
47264724

47274725
/**
@@ -4737,14 +4735,14 @@ void testNotExistsFilterOnJsonArrays(String dataStoreName) throws JsonProcessing
47374735
datastore.getCollectionForType(FLAT_COLLECTION_NAME, DocumentType.FLAT);
47384736

47394737
// Query using NOT_EXISTS on JSONB array field
4740-
// Test with attributes.colors field
4738+
// Test with props.colors field
47414739
Query query =
47424740
Query.builder()
47434741
.addSelection(IdentifierExpression.of("item"))
4744-
.addSelection(JsonIdentifierExpression.of("attributes", "colors"))
4742+
.addSelection(JsonIdentifierExpression.of("props", "colors"))
47454743
.setFilter(
47464744
RelationalExpression.of(
4747-
JsonArrayIdentifierExpression.of("attributes", "colors"),
4745+
JsonIdentifierExpression.of("props", JsonFieldType.STRING_ARRAY, "colors"),
47484746
NOT_EXISTS,
47494747
ConstantExpression.of("null")))
47504748
.build();
@@ -4762,22 +4760,21 @@ void testNotExistsFilterOnJsonArrays(String dataStoreName) throws JsonProcessing
47624760
returnedItems.add(item);
47634761

47644762
// Verify that returned documents have NULL parent, missing field, or empty arrays
4765-
JsonNode attributes = json.get("attributes");
4766-
if (attributes != null && attributes.isObject()) {
4767-
JsonNode colors = attributes.get("colors");
4763+
JsonNode props = json.get("props");
4764+
if (props != null && props.isObject()) {
4765+
JsonNode colors = props.get("colors");
47684766
assertTrue(
47694767
colors == null || !colors.isArray() || colors.isEmpty(),
47704768
"colors should be NULL or empty array for item: " + item + ", but was: " + colors);
47714769
}
4772-
// NULL attributes is also valid
4770+
// NULL props is also valid
47734771
}
47744772

4775-
// Should include documents where attributes is NULL or attributes.colors is NULL/empty
4776-
// Row 11 (Pencil) and other rows with empty/NULL colors
4773+
// Should include documents where props is NULL or props.colors is NULL/empty
4774+
// Row 7 (Comb) has empty colors array, rows 2,4,6,8,9,10 have NULL props
47774775
assertTrue(count > 0, "Should return at least some documents");
47784776
assertTrue(
4779-
returnedItems.contains("Pencil"),
4780-
"Should include Pencil (has empty colors array in attributes)");
4777+
returnedItems.contains("Comb"), "Should include Comb (has empty colors array in props)");
47814778
}
47824779
}
47834780

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,14 @@
11
{
22
"statements": [
3-
"INSERT INTO \"myTestFlat\" (\n\"_id\", \"item\", \"price\", \"quantity\", \"date\", \"tags\", \"categoryTags\", \"props\", \"sales\", \"numbers\", \"scores\", \"flags\", \"attributes\"\n) VALUES (\n1, 'Soap', 10, 2, '2014-03-01T08:00:00Z',\n'{\"hygiene\", \"personal-care\", \"premium\"}',\n'{\"Hygiene\", \"PersonalCare\"}',\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'{\"name\": \"Premium Soap\", \"certifications\": [\"ISO9001\", \"FDA\"], \"origin\": \"India\"}'\n)",
4-
"INSERT INTO \"myTestFlat\" (\n\"_id\", \"item\", \"price\", \"quantity\", \"date\", \"tags\", \"categoryTags\", \"props\", \"sales\", \"numbers\", \"scores\", \"flags\", \"attributes\"\n) VALUES (\n2, 'Mirror', 20, 1, '2014-03-01T09:00:00Z',\n'{\"home-decor\", \"reflective\", \"glass\"}',\n'{\"HomeDecor\"}',\nNULL,\nNULL,\n'{10, 20}',\nNULL,\nNULL,\n'{\"category\": \"HomeDecor\", \"tags\": []}'\n)",
5-
"INSERT INTO \"myTestFlat\" (\n\"_id\", \"item\", \"price\", \"quantity\", \"date\", \"tags\", \"categoryTags\", \"props\", \"sales\", \"numbers\", \"scores\", \"flags\", \"attributes\"\n) VALUES (\n3, 'Shampoo', 5, 10, '2014-03-15T09:00:00Z',\n'{\"hair-care\", \"personal-care\", \"premium\", \"herbal\"}',\n'{\"HairCare\", \"PersonalCare\"}',\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'{\"type\": \"shampoo\", \"ingredients\": [\"herbal\", \"natural\"]}'\n)",
6-
"INSERT INTO \"myTestFlat\" (\n\"_id\", \"item\", \"price\", \"quantity\", \"date\", \"tags\", \"categoryTags\", \"props\", \"sales\", \"numbers\", \"scores\", \"flags\", \"attributes\"\n) VALUES (\n4, 'Shampoo', 5, 20, '2014-04-04T11:21:39.736Z',\n'{\"hair-care\", \"budget\", \"bulk\"}',\n'{\"HairCare\"}',\nNULL,\nNULL,\nNULL,\nNULL,\n'{true, true}',\n'{\"brand\": \"Generic\"}'\n)",
7-
"INSERT INTO \"myTestFlat\" (\n\"_id\", \"item\", \"price\", \"quantity\", \"date\", \"tags\", \"categoryTags\", \"props\", \"sales\", \"numbers\", \"scores\", \"flags\", \"attributes\"\n) VALUES (\n5, 'Soap', 20, 5, '2014-04-04T21:23:13.331Z',\n'{\"hygiene\", \"antibacterial\", \"family-pack\"}',\n'{\"Hygiene\"}',\n'{\"colors\": [\"Orange\", \"Blue\"], \"brand\": \"Lifebuoy\", \"size\": \"S\", \"seller\": {\"name\": \"Hans and Co.\", \"address\": {\"city\": \"Kolkata\", \"pincode\": 700007}}}',\nNULL,\nNULL,\nNULL,\nNULL,\nNULL\n)",
8-
"INSERT INTO \"myTestFlat\" (\n\"_id\", \"item\", \"price\", \"quantity\", \"date\", \"tags\", \"categoryTags\", \"props\", \"sales\", \"numbers\", \"scores\", \"flags\", \"attributes\"\n) VALUES (\n6, 'Comb', 7.5, 5, '2015-06-04T05:08:13Z',\n'{\"grooming\", \"plastic\", \"essential\"}',\n'{\"Grooming\"}',\nNULL,\nNULL,\nNULL,\nNULL,\nNULL,\nNULL\n)",
9-
"INSERT INTO \"myTestFlat\" (\n\"_id\", \"item\", \"price\", \"quantity\", \"date\", \"tags\", \"categoryTags\", \"props\", \"sales\", \"numbers\", \"scores\", \"flags\", \"attributes\"\n) VALUES (\n7, 'Comb', 7.5, 10, '2015-09-10T08:43:00Z',\n'{\"grooming\", \"bulk\", \"wholesale\"}',\n'{\"Grooming\"}',\n'{\"colors\": [], \"seller\": {\"name\": \"Go Go Plastics\", \"address\": {\"city\": \"Kolkata\", \"pincode\": 700007}}}',\nNULL,\nNULL,\nNULL,\nNULL,\nNULL\n)",
10-
"INSERT INTO \"myTestFlat\" (\n\"_id\", \"item\", \"price\", \"quantity\", \"date\", \"tags\", \"categoryTags\", \"props\", \"sales\", \"numbers\", \"scores\", \"flags\", \"attributes\"\n) VALUES (\n8, 'Soap', 10, 5, '2016-02-06T20:20:13Z',\n'{\"hygiene\", \"budget\", \"basic\"}',\n'{\"Hygiene\"}',\nNULL,\nNULL,\nNULL,\nNULL,\nNULL,\nNULL\n)",
11-
"INSERT INTO \"myTestFlat\" (\n\"_id\", \"item\", \"price\", \"quantity\", \"date\", \"tags\", \"categoryTags\", \"props\", \"sales\", \"numbers\", \"scores\", \"flags\", \"attributes\"\n) VALUES (\n9, 'Bottle', 15, 3, '2016-03-01T10:00:00Z',\nNULL,\nNULL,\nNULL,\nNULL,\nNULL,\nNULL,\nNULL,\nNULL\n)",
12-
"INSERT INTO \"myTestFlat\" (\n\"_id\", \"item\", \"price\", \"quantity\", \"date\", \"tags\", \"categoryTags\", \"props\", \"sales\", \"numbers\", \"scores\", \"flags\", \"attributes\"\n) VALUES (\n10, 'Cup', 8, 2, '2016-04-01T10:00:00Z',\n'{}',\n'{}',\nNULL,\nNULL,\nNULL,\nNULL,\nNULL,\n'{\"material\": \"ceramic\", \"features\": []}'\n)",
13-
"INSERT INTO \"myTestFlat\" (\n\"_id\", \"item\", \"price\", \"quantity\", \"date\", \"tags\", \"categoryTags\", \"props\", \"sales\", \"numbers\", \"scores\", \"flags\", \"attributes\"\n) VALUES (\n11, 'Pencil', 2, 50, '2016-05-01T10:00:00Z',\n'{}',\nNULL,\nNULL,\nNULL,\n'{}',\n'{}',\n'{}',\n'{\"grade\": \"2B\", \"colors\": []}'\n)",
14-
"INSERT INTO \"myTestFlat\" (\n\"_id\", \"item\", \"price\", \"quantity\", \"date\", \"tags\", \"categoryTags\", \"props\", \"sales\", \"numbers\", \"scores\", \"flags\", \"attributes\"\n) VALUES (\n12, 'Eraser', 1, 100, '2016-06-01T10:00:00Z',\n'{\"stationery\"}',\n'{}',\nNULL,\nNULL,\n'{}',\nNULL,\n'{}',\n'{\"type\": \"rubber\", \"useCases\": [\"drawing\", \"writing\"]}'\n)",
15-
"INSERT INTO \"myTestFlat\" (\n\"_id\", \"item\", \"price\", \"quantity\", \"date\", \"tags\", \"categoryTags\", \"props\", \"sales\", \"numbers\", \"scores\", \"flags\", \"attributes\"\n) VALUES (\n13, 'Notebook', 25, 10, '2016-07-01T10:00:00Z',\nNULL,\n'{}',\nNULL,\nNULL,\nNULL,\n'{}',\nNULL,\nNULL\n)",
16-
"INSERT INTO \"myTestFlat\" (\n\"_id\", \"item\", \"price\", \"quantity\", \"date\", \"tags\", \"categoryTags\", \"props\", \"sales\", \"numbers\", \"scores\", \"flags\", \"attributes\"\n) VALUES (\n14, 'Pen', 5, 20, '2016-08-01T10:00:00Z',\n'{\"stationery\", \"writing\"}',\n'{\"Stationery\"}',\nNULL,\nNULL,\n'{5, 10, 15}',\n'{}',\n'{false}',\n'{\"brand\": \"Parker\", \"colors\": [\"black\", \"blue\", \"red\"]}'\n)"
3+
"INSERT INTO \"myTestFlat\" (\n\"_id\", \"item\", \"price\", \"quantity\", \"date\", \"tags\", \"categoryTags\", \"props\", \"sales\", \"numbers\", \"scores\", \"flags\"\n) VALUES (\n1, 'Soap', 10, 2, '2014-03-01T08:00:00Z',\n'{\"hygiene\", \"personal-care\", \"premium\"}',\n'{\"Hygiene\", \"PersonalCare\"}',\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)",
4+
"INSERT INTO \"myTestFlat\" (\n\"_id\", \"item\", \"price\", \"quantity\", \"date\", \"tags\", \"categoryTags\", \"props\", \"sales\", \"numbers\", \"scores\", \"flags\"\n) VALUES (\n2, 'Mirror', 20, 1, '2014-03-01T09:00:00Z',\n'{\"home-decor\", \"reflective\", \"glass\"}',\n'{\"HomeDecor\"}',\nNULL,\nNULL,\n'{10, 20}',\nNULL,\nNULL\n)",
5+
"INSERT INTO \"myTestFlat\" (\n\"_id\", \"item\", \"price\", \"quantity\", \"date\", \"tags\", \"categoryTags\", \"props\", \"sales\", \"numbers\", \"scores\", \"flags\"\n) VALUES (\n3, 'Shampoo', 5, 10, '2014-03-15T09:00:00Z',\n'{\"hair-care\", \"personal-care\", \"premium\", \"herbal\"}',\n'{\"HairCare\", \"PersonalCare\"}',\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)",
6+
"INSERT INTO \"myTestFlat\" (\n\"_id\", \"item\", \"price\", \"quantity\", \"date\", \"tags\", \"categoryTags\", \"props\", \"sales\", \"numbers\", \"scores\", \"flags\"\n) VALUES (\n4, 'Shampoo', 5, 20, '2014-04-04T11:21:39.736Z',\n'{\"hair-care\", \"budget\", \"bulk\"}',\n'{\"HairCare\"}',\nNULL,\nNULL,\nNULL,\nNULL,\n'{true, true}'\n)",
7+
"INSERT INTO \"myTestFlat\" (\n\"_id\", \"item\", \"price\", \"quantity\", \"date\", \"tags\", \"categoryTags\", \"props\", \"sales\", \"numbers\", \"scores\", \"flags\"\n) VALUES (\n5, 'Soap', 20, 5, '2014-04-04T21:23:13.331Z',\n'{\"hygiene\", \"antibacterial\", \"family-pack\"}',\n'{\"Hygiene\"}',\n'{\"colors\": [\"Orange\", \"Blue\"], \"brand\": \"Lifebuoy\", \"size\": \"S\", \"seller\": {\"name\": \"Hans and Co.\", \"address\": {\"city\": \"Kolkata\", \"pincode\": 700007}}}',\nNULL,\nNULL,\nNULL,\nNULL\n)",
8+
"INSERT INTO \"myTestFlat\" (\n\"_id\", \"item\", \"price\", \"quantity\", \"date\", \"tags\", \"categoryTags\", \"props\", \"sales\", \"numbers\", \"scores\", \"flags\"\n) VALUES (\n6, 'Comb', 7.5, 5, '2015-06-04T05:08:13Z',\n'{\"grooming\", \"plastic\", \"essential\"}',\n'{\"Grooming\"}',\nNULL,\nNULL,\nNULL,\nNULL,\nNULL\n)",
9+
"INSERT INTO \"myTestFlat\" (\n\"_id\", \"item\", \"price\", \"quantity\", \"date\", \"tags\", \"categoryTags\", \"props\", \"sales\", \"numbers\", \"scores\", \"flags\"\n) VALUES (\n7, 'Comb', 7.5, 10, '2015-09-10T08:43:00Z',\n'{\"grooming\", \"bulk\", \"wholesale\"}',\n'{\"Grooming\"}',\n'{\"colors\": [], \"seller\": {\"name\": \"Go Go Plastics\", \"address\": {\"city\": \"Kolkata\", \"pincode\": 700007}}}',\nNULL,\nNULL,\nNULL,\nNULL\n)",
10+
"INSERT INTO \"myTestFlat\" (\n\"_id\", \"item\", \"price\", \"quantity\", \"date\", \"tags\", \"categoryTags\", \"props\", \"sales\", \"numbers\", \"scores\", \"flags\"\n) VALUES (\n8, 'Soap', 10, 5, '2016-02-06T20:20:13Z',\n'{\"hygiene\", \"budget\", \"basic\"}',\n'{\"Hygiene\"}',\nNULL,\nNULL,\nNULL,\nNULL,\nNULL\n)",
11+
"INSERT INTO \"myTestFlat\" (\n\"_id\", \"item\", \"price\", \"quantity\", \"date\", \"tags\", \"categoryTags\", \"props\", \"sales\", \"numbers\", \"scores\", \"flags\"\n) VALUES (\n9, 'Bottle', 15, 3, '2016-03-01T10:00:00Z',\nNULL,\nNULL,\nNULL,\nNULL,\nNULL,\nNULL,\nNULL\n)",
12+
"INSERT INTO \"myTestFlat\" (\n\"_id\", \"item\", \"price\", \"quantity\", \"date\", \"tags\", \"categoryTags\", \"props\", \"sales\", \"numbers\", \"scores\", \"flags\"\n) VALUES (\n10, 'Cup', 8, 2, '2016-04-01T10:00:00Z',\n'{}',\n'{}',\nNULL,\nNULL,\nNULL,\nNULL,\nNULL\n)"
1713
]
1814
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
package org.hypertrace.core.documentstore.postgres.query.v1.parser.filter;
2+
3+
import org.hypertrace.core.documentstore.expression.impl.AggregateExpression;
4+
import org.hypertrace.core.documentstore.expression.impl.AliasedIdentifierExpression;
5+
import org.hypertrace.core.documentstore.expression.impl.ArrayIdentifierExpression;
6+
import org.hypertrace.core.documentstore.expression.impl.ConstantExpression;
7+
import org.hypertrace.core.documentstore.expression.impl.ConstantExpression.DocumentConstantExpression;
8+
import org.hypertrace.core.documentstore.expression.impl.FunctionExpression;
9+
import org.hypertrace.core.documentstore.expression.impl.IdentifierExpression;
10+
import org.hypertrace.core.documentstore.expression.impl.JsonFieldType;
11+
import org.hypertrace.core.documentstore.expression.impl.JsonIdentifierExpression;
12+
import org.hypertrace.core.documentstore.parser.SelectTypeExpressionVisitor;
13+
14+
/**
15+
* Visitor to detect the category of a field expression for array-aware SQL generation.
16+
*
17+
* <p>Categorizes fields into three types:
18+
*
19+
* <ul>
20+
* <li><b>SCALAR:</b> Regular fields and JSON primitives (strings, numbers, booleans, objects)
21+
* <li><b>POSTGRES_ARRAY:</b> Native PostgreSQL arrays (text[], integer[], boolean[], etc.)
22+
* <li><b>JSONB_ARRAY:</b> Arrays inside JSONB columns with JsonFieldType annotation
23+
* </ul>
24+
*
25+
* <p>This categorization is used by EXISTS/NOT_EXISTS parsers to generate appropriate SQL:
26+
*
27+
* <ul>
28+
* <li>SCALAR: {@code IS NOT NULL / IS NULL}
29+
* <li>POSTGRES_ARRAY: {@code IS NOT NULL AND cardinality(...) > 0}
30+
* <li>JSONB_ARRAY: {@code IS NOT NULL AND jsonb_array_length(...) > 0}
31+
* </ul>
32+
*/
33+
class PostgresArrayFieldDetector implements SelectTypeExpressionVisitor {
34+
35+
/** Field category for determining appropriate SQL generation strategy */
36+
enum FieldCategory {
37+
SCALAR, // Regular fields and JSON primitives
38+
ARRAY, // Native PostgreSQL arrays (text[], int[], etc.)
39+
JSONB_ARRAY // Arrays inside JSONB columns
40+
}
41+
42+
@Override
43+
public FieldCategory visit(ArrayIdentifierExpression expression) {
44+
return FieldCategory.ARRAY;
45+
}
46+
47+
@Override
48+
public FieldCategory visit(JsonIdentifierExpression expression) {
49+
return expression
50+
.getFieldType()
51+
.filter(
52+
type ->
53+
type == JsonFieldType.STRING_ARRAY
54+
|| type == JsonFieldType.NUMBER_ARRAY
55+
|| type == JsonFieldType.BOOLEAN_ARRAY
56+
|| type == JsonFieldType.OBJECT_ARRAY)
57+
.map(type -> FieldCategory.JSONB_ARRAY)
58+
.orElse(FieldCategory.SCALAR);
59+
}
60+
61+
@Override
62+
public FieldCategory visit(IdentifierExpression expression) {
63+
return FieldCategory.SCALAR;
64+
}
65+
66+
@Override
67+
public FieldCategory visit(AggregateExpression expression) {
68+
return FieldCategory.SCALAR;
69+
}
70+
71+
@Override
72+
public FieldCategory visit(ConstantExpression expression) {
73+
return FieldCategory.SCALAR;
74+
}
75+
76+
@Override
77+
public FieldCategory visit(DocumentConstantExpression expression) {
78+
return FieldCategory.SCALAR;
79+
}
80+
81+
@Override
82+
public FieldCategory visit(FunctionExpression expression) {
83+
return FieldCategory.SCALAR;
84+
}
85+
86+
@Override
87+
public FieldCategory visit(AliasedIdentifierExpression expression) {
88+
return FieldCategory.SCALAR;
89+
}
90+
}

0 commit comments

Comments
 (0)