Skip to content

Commit be92dae

Browse files
hbarthelsclaudecomnik
authored
Add a (FIXED N) type for fixed-length byte arrays (#277)
* Add a (FIXED N) type for fixed-length byte arrays `FixedType { int32 length }` in the `Type` oneof, written `(FIXED N)`. In CSV data a value is 2N hex digits, most significant byte first. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Update proto/relationalai/lqp/v1/logic.proto Co-authored-by: Nikolas Göbel <nikolas.goebel@relational.ai> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: Nikolas Göbel <nikolas.goebel@relational.ai>
1 parent 4744b0a commit be92dae

20 files changed

Lines changed: 15084 additions & 14617 deletions

File tree

‎meta/src/meta/grammar.y‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,7 @@
147147
%nonterm false logic.Disjunction
148148
%nonterm ffi logic.FFI
149149
%nonterm ffi_args Sequence[logic.Abstraction]
150+
%nonterm fixed_type logic.FixedType
150151
%nonterm float_type logic.FloatType
151152
%nonterm float32_type logic.Float32Type
152153
%nonterm formula logic.Formula
@@ -579,6 +580,10 @@ type
579580
construct: $$ = logic.Type(uint32_type=$1)
580581
deconstruct if builtin.has_proto_field($$, 'uint32_type'):
581582
$1: logic.UInt32Type = $$.uint32_type
583+
| fixed_type
584+
construct: $$ = logic.Type(fixed_type=$1)
585+
deconstruct if builtin.has_proto_field($$, 'fixed_type'):
586+
$1: logic.FixedType = $$.fixed_type
582587

583588
unspecified_type
584589
: "UNKNOWN"
@@ -635,6 +640,12 @@ decimal_type
635640
$3: Int64 = builtin.int32_to_int64($$.precision)
636641
$4: Int64 = builtin.int32_to_int64($$.scale)
637642

643+
fixed_type
644+
: "(" "FIXED" INT ")"
645+
construct: $$ = logic.FixedType(length=builtin.int64_to_int32($3))
646+
deconstruct:
647+
$3: Int64 = builtin.int32_to_int64($$.length)
648+
638649
boolean_type
639650
: "BOOLEAN"
640651
construct: $$ = logic.BooleanType()

‎proto/relationalai/lqp/v1/logic.proto‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -425,6 +425,7 @@ message Type {
425425
Int32Type int32_type = 12;
426426
Float32Type float32_type = 13;
427427
UInt32Type uint32_type = 14;
428+
FixedType fixed_type = 15;
428429
}
429430
}
430431

@@ -459,6 +460,11 @@ message Float32Type {}
459460

460461
message UInt32Type {}
461462

463+
// A fixed-length byte array of `length` bytes.
464+
message FixedType {
465+
int32 length = 1;
466+
}
467+
462468
message Value {
463469
oneof value {
464470
string string_value = 1;

‎sdks/go/src/lqp/v1/logic.pb.go‎

Lines changed: 221 additions & 150 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)