Skip to content

Commit

Permalink
Prepare 0.14.8 release (#1554)
Browse files Browse the repository at this point in the history
  • Loading branch information
alancai98 authored Aug 19, 2024
1 parent 945558c commit 546a126
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 7 deletions.
5 changes: 3 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
Thank you to all who have contributed!
-->

## [Unreleased]
## [0.14.8]

### Added

Expand Down Expand Up @@ -1110,7 +1110,8 @@ breaking changes if migrating from v0.9.2. The breaking changes accidentally int
### Added
Initial alpha release of PartiQL.

[Unreleased]: https://github.com/partiql/partiql-lang-kotlin/compare/v0.14.7...HEAD
[Unreleased]: https://github.com/partiql/partiql-lang-kotlin/compare/v0.14.8...HEAD
[0.14.8]: https://github.com/partiql/partiql-lang-kotlin/compare/v0.14.7...v0.14.8
[0.14.7]: https://github.com/partiql/partiql-lang-kotlin/compare/v0.14.6...v0.14.7
[0.14.6]: https://github.com/partiql/partiql-lang-kotlin/compare/v0.14.5...v0.14.6
[0.14.5]: https://github.com/partiql/partiql-lang-kotlin/compare/v0.14.4...v0.14.5
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ This project is published to [Maven Central](https://search.maven.org/artifact/o

| Group ID | Artifact ID | Recommended Version |
|---------------|-----------------------|---------------------|
| `org.partiql` | `partiql-lang-kotlin` | `0.14.6` |
| `org.partiql` | `partiql-lang-kotlin` | `0.14.8` |


For Maven builds, add the following to your `pom.xml`:
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
group=org.partiql
version=0.14.8-SNAPSHOT
version=0.14.8

ossrhUsername=EMPTY
ossrhPassword=EMPTY
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ internal class DynamicTyper {
// If a collection, then return union of all accumulated types as these coercion rules are not defined by SQL.
STRUCT, BAG, LIST, SEXP -> return StaticType.unionOf(types + modifiers) to null
DECIMAL -> {
val type = computeDecimal()
val type = computeConstrainedDecimal()
// coercion required. fall back
if (type == null) superT else return StaticType.unionOf(setOf(type) + modifiers).flatten() to null
}
Expand All @@ -163,10 +163,11 @@ internal class DynamicTyper {
}
}

private fun computeDecimal(): DecimalType? {
private fun computeConstrainedDecimal(): DecimalType? {
val (precision, scale) = types.fold((0 to 0)) { acc, staticType ->
val decimalType = staticType as? DecimalType ?: return null
val constr = decimalType.precisionScaleConstraint as DecimalType.PrecisionScaleConstraint.Constrained
val constr = decimalType.precisionScaleConstraint as? DecimalType.PrecisionScaleConstraint.Constrained
?: throw IllegalStateException("Expected a constrained decimal type")
val precision = max(constr.precision, acc.first)
val scale = max(constr.scale, acc.second)
precision to scale
Expand Down

0 comments on commit 546a126

Please sign in to comment.