You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
PIG has the following restrictions for product elements:
All required elements must come first.
Only one of the following options may come next:
Any number or optional elements.
A single variadic element.
(Note that record types do not have the same restrictions.)
The reasons the restrictions above are historical in nature: it was to force the serialized forms of PIG type domains to be closer to the design of the V0 AST and therefore ease migration from the V0 AST to the partiql_ast PIG type domain. In the V0 AST, all optional elements were added to the end of a product instance or simply omitted to indicate that they were not present. Since the same was also true to for variadic elements, it would be impossible to differentiate between optional elements and the values of the variadic element; thus a product could not have optional and variadic elements.
The Proposed State
Since the above restrictions were first conceived we have changed the s-expression form of PIG products to use Ion's null.null to represent not-present optional product elements, which means that we can now allow required and optional elements to be specified in any order.
The above restrictions could simply be changed to:
There may be only one variadic element.
If present, the variadic element must be the last element.
If #76 was implemented, it would the be possible to remove these restrictions entirely, thereby allowing required, optional, and variadic elements to be specified in any order, without restrictions.
Backward Compatibility
We will need to do some research to see if there are other tools which require these rules to be in place--this may be a backward-incompatible change.
The text was updated successfully, but these errors were encountered:
The Current State
PIG has the following restrictions for
product
elements:(Note that
record
types do not have the same restrictions.)The reasons the restrictions above are historical in nature: it was to force the serialized forms of PIG type domains to be closer to the design of the
V0
AST and therefore ease migration from theV0
AST to thepartiql_ast
PIG type domain. In theV0
AST, all optional elements were added to the end of aproduct
instance or simply omitted to indicate that they were not present. Since the same was also true to for variadic elements, it would be impossible to differentiate between optional elements and the values of the variadic element; thus aproduct
could not have optional and variadic elements.The Proposed State
Since the above restrictions were first conceived we have changed the s-expression form of PIG
product
s to use Ion'snull.null
to represent not-present optional product elements, which means that we can now allow required and optional elements to be specified in any order.The above restrictions could simply be changed to:
If #76 was implemented, it would the be possible to remove these restrictions entirely, thereby allowing required, optional, and variadic elements to be specified in any order, without restrictions.
Backward Compatibility
We will need to do some research to see if there are other tools which require these rules to be in place--this may be a backward-incompatible change.
The text was updated successfully, but these errors were encountered: