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
Currently, the values of variadic elements are added to the end of a product definition. For example, given the definition:
(product nary op::operator args::expr)
The values of the variadic element appear at the end. The following nary instance has 3 values of the args element (denoted with a ^).
(nary (plus) (lit 1) (lit 2) (lit 2))
// ^ ^ ^
The reason for modeling variadic elements in this fashion is that it helped adoption by one of our customers who were heavily reliant on the PartiQL V0 AST, which modeled its variadic elements in this fashion, however, that customer as since moved on from the V0 AST and this is no longer a consideration.
The primary disadvantage of this approach is that PIG product types are limited to only one variadic element, and that element must be the last element of the product.
The Proposed State
We should consider modeling variadic elements as lists instead:
(nary (plus) [(lit 1), (lit 2), (lit 2)])
This would allow PIG's product to contain more than one variadic element in any position.
Backward Compatibility
This would be a backward-incompatible change. Data persisted with older versions of PIG will not be easily readable by the newer versions. Consumers of the s-expression form of the AST will need to be updated to account for the new way variadic elements are modeled. Before this can be implemented, we will need to determine a strategy for dealing with the downstream impacts of this change.
The text was updated successfully, but these errors were encountered:
dlurton
changed the title
Model Variadic Elemnts with an Ion List
Model Variadic Elements with an Ion List
Jun 7, 2021
The Current State
Currently, the values of variadic elements are added to the end of a product definition. For example, given the definition:
The values of the variadic element appear at the end. The following
nary
instance has 3 values of theargs
element (denoted with a^
).The reason for modeling variadic elements in this fashion is that it helped adoption by one of our customers who were heavily reliant on the PartiQL
V0
AST, which modeled its variadic elements in this fashion, however, that customer as since moved on from theV0
AST and this is no longer a consideration.The primary disadvantage of this approach is that PIG
product
types are limited to only one variadic element, and that element must be the last element of the product.The Proposed State
We should consider modeling variadic elements as lists instead:
This would allow PIG's
product
to contain more than one variadic element in any position.Backward Compatibility
This would be a backward-incompatible change. Data persisted with older versions of PIG will not be easily readable by the newer versions. Consumers of the s-expression form of the AST will need to be updated to account for the new way variadic elements are modeled. Before this can be implemented, we will need to determine a strategy for dealing with the downstream impacts of this change.
The text was updated successfully, but these errors were encountered: