Skip to content

Commit 6607b21

Browse files
committed
Add bytea data type
1 parent 5bd4de7 commit 6607b21

File tree

3 files changed

+12
-1
lines changed

3 files changed

+12
-1
lines changed

document-store/src/main/java/org/hypertrace/core/documentstore/expression/impl/ArrayIdentifierExpression.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,10 @@ public static ArrayIdentifierExpression ofUuids(final String name) {
8383
return of(name, PostgresDataType.UUID);
8484
}
8585

86+
public static ArrayIdentifierExpression ofBytesArray(final String name) {
87+
return of(name, PostgresDataType.BYTEA);
88+
}
89+
8690
// Package-private: used internally by getPostgresArrayTypeString()
8791
Optional<FlatCollectionDataType> getArrayElementType() {
8892
return Optional.ofNullable(arrayElementType);
@@ -130,6 +134,8 @@ private String toPostgresArrayType(FlatCollectionDataType type) {
130134
return "double precision[]";
131135
case "bool":
132136
return "boolean[]";
137+
case "bytea":
138+
return "bytea[]";
133139
default:
134140
// For most types, just append []
135141
return baseType + "[]";

document-store/src/main/java/org/hypertrace/core/documentstore/expression/impl/IdentifierExpression.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,10 @@ public static IdentifierExpression ofJsonb(final String name) {
9797
return of(name, PostgresDataType.JSONB);
9898
}
9999

100+
public static IdentifierExpression ofBytes(final String name) {
101+
return of(name, PostgresDataType.BYTEA);
102+
}
103+
100104
@Override
101105
public <T> T accept(final GroupTypeExpressionVisitor visitor) {
102106
return visitor.visit(this);

document-store/src/main/java/org/hypertrace/core/documentstore/expression/impl/PostgresDataType.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ enum PostgresDataType implements FlatCollectionDataType {
3131
TIMESTAMPTZ("timestamptz"),
3232
DATE("date"),
3333
UUID("uuid"),
34-
JSONB("jsonb");
34+
JSONB("jsonb"),
35+
BYTEA("bytea"); // Java: byte[], ByteBuffer (binary data)
3536

3637
private final String pgTypeName;
3738

0 commit comments

Comments
 (0)