Skip to content

Commit

Permalink
roll back PVT <> ST mapping
Browse files Browse the repository at this point in the history
  • Loading branch information
yliuuuu committed Feb 23, 2024
1 parent c3b6e66 commit 1a39231
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -121,10 +121,11 @@ private fun StaticType.asRuntimeType(): PartiQLValueType = when (this) {
is ListType -> PartiQLValueType.LIST
is SexpType -> PartiQLValueType.SEXP
is DateType -> PartiQLValueType.DATE
is DecimalType -> when (this.precisionScaleConstraint) {
is DecimalType.PrecisionScaleConstraint.Constrained -> PartiQLValueType.DECIMAL
DecimalType.PrecisionScaleConstraint.Unconstrained -> PartiQLValueType.DECIMAL_ARBITRARY
}
// TODO: Run time decimal type does not model precision scale constraint yet
// even though we can match to Decimal vs Decimal_ARBITRARY (PVT) here
// but when mapping it back to Static Type, (i.e, mapping function return type to Value Type)
// we can only map to Unconstrained decimal (Static Type)
is DecimalType -> PartiQLValueType.DECIMAL_ARBITRARY
is FloatType -> PartiQLValueType.FLOAT64
is GraphType -> error("Graph type missing from runtime types")
is IntType -> when (this.rangeConstraint) {
Expand Down

0 comments on commit 1a39231

Please sign in to comment.