Skip to content

v1.5.0

Latest

Choose a tag to compare

@xd1313113 xd1313113 released this 02 Jul 03:44
f7212fd

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.

RFC: https://github.com/partiql/partiql-lang/pull/104/changes#diff-b4c85ef02e6da4491d1c40425a39177d6c3dc9e2f4847501a42463dca8365cf8

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 MAP lookup key type if needed for bracket notation, map_contains_key function and map_get function.
  • Added MAP type operation support: CAST and UNPIVOT
  • Added MAP type 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