Convert selecting a named tuple into a free object#776
Open
scotttrinh wants to merge 15 commits intomasterfrom
Open
Convert selecting a named tuple into a free object#776scotttrinh wants to merge 15 commits intomasterfrom
scotttrinh wants to merge 15 commits intomasterfrom
Conversation
Type checks at this point, so going to use this as a savepoint
3fbacce to
81ae623
Compare
scotttrinh
commented
Nov 30, 2023
| expr = $for(expr as TypeSet<NamedTupleType>, (forScope) => { | ||
| const shape: any = {}; | ||
| for (const k of Object.keys(forScope.__element__.__shape__)) { | ||
| shape[k] = op("distinct", (forScope as any)[k]); |
Collaborator
Author
There was a problem hiding this comment.
This distinct operator is a hack for dealing with geldata/gel#6530.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Right now we do not allow selecting shapes on named tuples, so in order to support FTS, the simplest way forward is to convert any named tuples to a free object using a
forexpression.There is one outstanding issue geldata/gel#6530 that requires an additional (hopefully temporary) hack for the output of
fts::searchto work properly: the compiler complains that theobjectcomputed in the resulting free object is not distinct, so we applydistinctto all of the named tuple's properties which should be a no-op.There is some talk about making the output of
fts::searchinto a free object in it's own right in the future, which is fine: everything will just work but now the query builder will be able to select shapes from named tuples.