Skip to content

Commit 2edb74e

Browse files
committed
Add Map core edition
Signed-off-by: Adam Gutglick <adam@spiraldb.com>
1 parent 90404ef commit 2edb74e

6 files changed

Lines changed: 74 additions & 6 deletions

File tree

vortex-python/src/io.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@ impl PyVortexWriteOptions {
303303
/// >>> vx.io.VortexWriteOptions.default().write(sprl, "chonky.vortex")
304304
/// >>> import os
305305
/// >>> os.path.getsize('chonky.vortex')
306-
/// 215900
306+
/// 215932
307307
///
308308
/// Wow, Vortex manages to use about two bytes per integer! So advanced. So tiny.
309309
///
@@ -313,7 +313,7 @@ impl PyVortexWriteOptions {
313313
///
314314
/// >>> vx.io.VortexWriteOptions.compact().write(sprl, "tiny.vortex")
315315
/// >>> os.path.getsize('tiny.vortex')
316-
/// 55028
316+
/// 55060
317317
///
318318
/// Random numbers are not (usually) composed of random bytes!
319319
#[staticmethod]
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# SPDX-License-Identifier: Apache-2.0
2+
# SPDX-FileCopyrightText: Copyright the Vortex contributors
3+
4+
include ../setup.slt.no
5+
6+
query I
7+
COPY (
8+
SELECT id, map(keys, vals) AS attrs
9+
FROM (VALUES
10+
(1, [1, 2], ['one', CAST(NULL AS VARCHAR)]),
11+
(2, [], []),
12+
(3, [3], ['three'])
13+
) AS t(id, keys, vals)
14+
) TO '${WORK_DIR}/datafusion/map_roundtrip/maps.vortex'
15+
STORED AS VORTEX;
16+
----
17+
3
18+
19+
statement ok
20+
CREATE VIEW map_rows AS SELECT * FROM '${WORK_DIR}/datafusion/map_roundtrip/maps.vortex';
21+
22+
query I? rowsort
23+
SELECT id, attrs FROM map_rows;
24+
----
25+
1 {1: one, 2: NULL}
26+
2 {}
27+
3 {3: three}
28+
29+
query II??? rowsort
30+
SELECT
31+
id,
32+
cardinality(attrs),
33+
map_keys(attrs),
34+
map_values(attrs),
35+
map_extract(attrs, 2)
36+
FROM map_rows;
37+
----
38+
1 2 [1, 2] [one, NULL] [NULL]
39+
2 0 [] [] [NULL]
40+
3 1 [3] [three] [NULL]
41+
42+
statement ok
43+
DROP VIEW map_rows;

vortex/src/editions/core/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,10 @@ pub mod v2025_05;
1010
pub mod v2025_06;
1111
pub mod v2025_10;
1212
pub mod v2026_07;
13+
pub mod v2026_08_1;
1314

1415
pub use v2025_05::CORE_2025_05_0;
1516
pub use v2025_06::CORE_2025_06_0;
1617
pub use v2025_10::CORE_2025_10_0;
1718
pub use v2026_07::CORE_2026_07_0;
19+
pub use v2026_08_1::CORE_2026_08_1;
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
// SPDX-License-Identifier: Apache-2.0
2+
// SPDX-FileCopyrightText: Copyright the Vortex contributors
3+
4+
//! The August 2026 core edition revision adding the canonical Map encoding.
5+
6+
use vortex_edition::Edition;
7+
use vortex_edition::EditionDeclaration;
8+
use vortex_edition::EditionId;
9+
10+
/// The August 2026 core edition revision containing canonical Map arrays.
11+
pub const CORE_2026_08_1: EditionId = EditionId::new("core", 2026, 8, 1);
12+
13+
/// The declaration of [`CORE_2026_08_1`] and the encodings that join the family at it.
14+
pub static DECLARATION: EditionDeclaration = EditionDeclaration {
15+
edition: Edition {
16+
id: CORE_2026_08_1,
17+
min_vortex_version: Some("0.84.0"),
18+
},
19+
added: &[&"vortex.map"],
20+
};

vortex/src/editions/mod.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
//! policy with [`crate::editions::enable_default_editions`].
1010
//!
1111
//! The default file writer resolves the session's enabled editions at write time. The
12-
//! facade enables the newest frozen `core` edition, [`crate::editions::CORE_2026_07_0`], and
12+
//! facade enables the newest frozen `core` edition, [`crate::editions::CORE_2026_08_1`], and
1313
//! additionally enables the latest unstable edition when the `unstable_encodings` feature is
1414
//! selected.
1515
@@ -33,13 +33,14 @@ pub use self::core::CORE_2025_05_0;
3333
pub use self::core::CORE_2025_06_0;
3434
pub use self::core::CORE_2025_10_0;
3535
pub use self::core::CORE_2026_07_0;
36+
pub use self::core::CORE_2026_08_1;
3637
pub use self::unstable::UNSTABLE_2025_05_0;
3738
pub use self::unstable::UNSTABLE_2026_02_0;
3839
pub use self::unstable::UNSTABLE_2026_04_0;
3940
pub use self::unstable::UNSTABLE_2026_06_0;
4041

4142
/// The `core` edition enabled for writing by the default Vortex session.
42-
pub const DEFAULT_CORE_EDITION: EditionId = CORE_2026_07_0;
43+
pub const DEFAULT_CORE_EDITION: EditionId = CORE_2026_08_1;
4344

4445
/// The `unstable` edition enabled for writing by the default Vortex session when the
4546
/// `unstable_encodings` feature is selected.
@@ -51,6 +52,7 @@ pub static EDITION_DECLARATIONS: &[&EditionDeclaration] = &[
5152
&core::v2025_06::DECLARATION,
5253
&core::v2025_10::DECLARATION,
5354
&core::v2026_07::DECLARATION,
55+
&core::v2026_08_1::DECLARATION,
5456
&unstable::v2025_05::DECLARATION,
5557
&unstable::v2026_02::DECLARATION,
5658
&unstable::v2026_04::DECLARATION,

vortex/src/editions/tests.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ use vortex_utils::aliases::hash_set::HashSet;
3939

4040
use super::CORE_2025_05_0;
4141
use super::CORE_2026_07_0;
42+
use super::CORE_2026_08_1;
4243
use super::DEFAULT_CORE_EDITION;
4344
use super::DEFAULT_UNSTABLE_EDITION;
4445
use super::EDITION_DECLARATIONS;
@@ -138,7 +139,7 @@ fn encodings_in_editions_unions_families() {
138139
fn earlier_editions_are_subsets() {
139140
let session = session().unwrap_or_else(|e| panic!("registering editions: {e}"));
140141
let first = session.encodings_in(&CORE_2025_05_0);
141-
let latest = session.encodings_in(&CORE_2026_07_0);
142+
let latest = session.encodings_in(&CORE_2026_08_1);
142143
assert!(first.iter().all(|inclusion| {
143144
latest
144145
.iter()
@@ -169,7 +170,7 @@ fn core_edition_ids_are_registered_array_encodings() {
169170

170171
let session = VortexSession::default();
171172
let registry = session.arrays().registry().clone();
172-
for inclusion in session.editions().encodings_in(&CORE_2026_07_0) {
173+
for inclusion in session.editions().encodings_in(&CORE_2026_08_1) {
173174
assert!(
174175
registry.contains_key(&inclusion.encoding_id),
175176
"{} is declared in core but not registered as an array encoding",

0 commit comments

Comments
 (0)