New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Expressions for use with maps #89
Comments
Earlier note from @alecgrieser: Protobuf supports, as a field type, the "map" type, which, like the name suggests, allows for users to store (using a single field), a mapping of elements from one type to elements of another type:
If it matters to anyone, they store this as a repeated list of messages when serialized to bytes:
so there is already a way to support most of what anyone would want to do with this kind of thing, but the ergonomics could be better. Presumably, we would need a new Key.Expression type. Probably something like:
And:
These would then have the same semantics as key expressions on Then you would specify that you are interested in querying this field with something like:
Which would be equivalent to:
(And the same kind of shenanigans for value types.) FanType: IMO, most of the sensible indexes would use the map fields in a manner that is equivalent to using field-based indexes with the FanOut FanType. I'm struggling to see what the case for concatenated might be, but maybe there is one, I don't know. |
Resolves #89: Expressions for use with maps
Since
map
is just shorthand for arepeated
message with two fields numbered 1 and 2 (namedkey
andvalue
-- but I do not believe that is guaranteed), I think this means variants ofFieldKeyExpression
andBaseField
that take field numbers instead of field names, plus support in the planner for matching the two where it now just checksequals
ofgetFieldName
.The text was updated successfully, but these errors were encountered: