Replies: 7 comments
-
By embedding product in platform and then disjuncting them , you have created a subset situation. CUE cannot disambiguate a subset from the superset. See #1163 for more details |
Beta Was this translation helpful? Give feedback.
-
Thanks @verdverm From a data modeling standpoint, a platform can be "many products" aggregated |
Beta Was this translation helpful? Give feedback.
-
Long-term: this is the comment to pay attention to: #1163 (reply in thread) Short-term, you can use a discriminator field. Something that is in the data that can uniquely separate them, as I have used We could refine this depending on desired output and the data characteristics. @myitcv should we convert this to a discussion? |
Beta Was this translation helpful? Give feedback.
-
Thanks again @verdverm for the suggestion. I will try tonight. |
Beta Was this translation helpful? Give feedback.
-
You'd have to ask @myitcv that one. I run https://cuetorials.com and would love to collab on the field subset problem/ example there. I have some thoughts already, if you open a discussion on the repo, we can iterate. |
Beta Was this translation helpful? Give feedback.
-
The way to disambiguate in this case is to set a default value:
This picks the less specific version in case both succeed. Much older versions of CUE were "smarter" and picked less specific cases over more specific cases. But this was a bit magical, aside from potential runtime inefficiencies, so we require explicit I do think there is merit detecting subsumed and thus redundant values in disjunctions in a |
Beta Was this translation helpful? Give feedback.
-
Can disjunction be applied on two different types of schemas?
What version of CUE are you using (
cue version
)?What did you do?
What did you expect to see?
What did you see instead?
Beta Was this translation helpful? Give feedback.
All reactions