PartiQL Kotlin v1.5.0
We're excited to announce that PartiQL v1.5.0 introduces first-class support for the MAP type. A MAP is an parameterized and unordered collection of entries where each entry associates a key of type K with a value of type V. Unlike Struct, a MAP<K, V> holds key-value pairs with uniformly typed keys and values.
What's New:
Type System
- MAP<K, V> as a first-class PartiQL type with parameterized key and value types
Construction & Access
-- MAP literal syntax
MAP { 'name': 'Alice', 'age': 30 }
-- Bracket lookup
MAP { 'a': 1, 'b': 2 }['a'] -- 1
MAP { 1: 'one', 2: 'two' }[1] -- 'one'
-- Implicit key casting (integer key looked up with decimal)
MAP { 1: 'one', 2: 'two' }[1.0] -- 'one'
Built-in Functions
- map_keys(m) — returns a bag of all keys
- map_values(m) — returns a bag of all values
- map_entries(m) — returns a bag of key-value pair structs
- map_contains_key(m, k) — returns true if the key exists
- map_get(m, k) — returns the value for a given key
Operations
- UNPIVOT — iterate over MAP entries
- CAST — convert between MAP and STRUCT
Added
- Added SqlDialect support for MAP expression and type serialization
- Added MAP functions: map_contains_key, map_get, map_keys, map_values, map_entries, size, exists, cardinality and `IS MAP<K, V>
- Added implicit cast for
MAPlookup key type if needed for bracket notation, map_contains_key function and map_get function. - Added MAP type operation support: CAST and UNPIVOT
- Added
MAPtype parsing in DatumIonReader for CLI and Conformance tests - Added Support for correlated Join.
Changed
Deprecated
Fixed
- Fixed NullPointerException in RelOpUnpivot when UNPIVOT encounters a typed null value
- Fixed SELECT * with UNPIVOT to use named aliases instead of positional names
Removed
Security
Contributors
Thank you to all who have contributed!
List of commits: v1.4.0...v.1.5.0