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
Right now, if you attempt to deserialize a TypeSignature of the form DECIMAL(a,b), a type signature is returned with two parameters: a, and b. These parameters are recognized as types.
DECIMAL(1,2) does not have any issue: because the input is numeric, we correctly interpret the parameters to be constant longs. But because a and b could represent both a user-supplied built in Type, and a variable, Presto simply chooses the type indescriminately.
In the code, you can specify that a and b are variables by using a constructor argument. However, it would be convenient to define inline that the parameters are actually variables, not types.
I propose the following syntax modeled on Scala pattern matching:
Decimal($_,$_) - there are two anonymous variables (the variable names do not matter and are anonymous) Decimal($a,$a) - there is one named variable used in two different places Decimal(BIGINT,VARCHAR) - there are two types, BIGINT and VARCHAR
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Right now, if you attempt to deserialize a TypeSignature of the form
DECIMAL(a,b)
, a type signature is returned with two parameters:a
, andb
. These parameters are recognized as types.DECIMAL(1,2)
does not have any issue: because the input is numeric, we correctly interpret the parameters to be constant longs. But becausea
andb
could represent both a user-supplied built in Type, and a variable, Presto simply chooses the type indescriminately.In the code, you can specify that
a
andb
are variables by using a constructor argument. However, it would be convenient to define inline that the parameters are actually variables, not types.I propose the following syntax modeled on Scala pattern matching:
Decimal($_,$_)
- there are two anonymous variables (the variable names do not matter and are anonymous)Decimal($a,$a)
- there is one named variable used in two different placesDecimal(BIGINT,VARCHAR)
- there are two types,BIGINT
andVARCHAR
Beta Was this translation helpful? Give feedback.
All reactions