Skip to content

Commit

Permalink
Merge 5651457 into f42e74f
Browse files Browse the repository at this point in the history
  • Loading branch information
alancai98 authored Mar 19, 2024
2 parents f42e74f + 5651457 commit d1999fd
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 15 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ Thank you to all who have contributed!
### Added

### Changed
- Change `StaticType.AnyOfType`'s `.toString` to not perform `.flatten()`

### Deprecated

Expand Down Expand Up @@ -165,6 +166,7 @@ Thank you to all who have contributed!

### Deprecated


### Fixed
- Fixes the CLI hanging on invalid queries. See issue #1230.
- Fixes Timestamp Type parsing issue. Previously Timestamp Type would get parsed to a Time type.
Expand Down
19 changes: 4 additions & 15 deletions partiql-types/src/main/kotlin/org/partiql/types/StaticType.kt
Original file line number Diff line number Diff line change
Expand Up @@ -642,21 +642,10 @@ public data class AnyOfType(val types: Set<StaticType>, override val metas: Map<
}
}

override fun toString(): String =
when (val flattenedType = flatten()) {
is AnyOfType -> {
val unionedTypes = flattenedType.types
when (unionedTypes.size) {
0 -> "\$null"
1 -> unionedTypes.first().toString()
else -> {
val types = unionedTypes.joinToString { it.toString() }
"union($types)"
}
}
}
else -> flattenedType.toString()
}
override fun toString(): String {
val types = types.joinToString { it.toString() }
return "union($types)"
}

override val allTypes: List<StaticType>
get() = this.types.map { it.flatten() }
Expand Down

0 comments on commit d1999fd

Please sign in to comment.