Skip to content

Commit 076647e

Browse files
Merge branch 'main' into adityasn/add-spec-partition-field-reuse
2 parents e3d2cc3 + 3c9df9e commit 076647e

16 files changed

Lines changed: 351 additions & 119 deletions

File tree

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
#!/bin/bash
2-
#
31
# Licensed to the Apache Software Foundation (ASF) under one
42
# or more contributor license agreements. See the NOTICE file
53
# distributed with this work for additional information
@@ -16,18 +14,22 @@
1614
# KIND, either express or implied. See the License for the
1715
# specific language governing permissions and limitations
1816
# under the License.
19-
#
20-
21-
set -e
22-
23-
start-master.sh -p 7077
24-
start-worker.sh spark://spark-iceberg:7077
2517

26-
echo "Starting provision"
27-
python3 ./provision.py
18+
name: Get MSRV
19+
description: Get the Minimum Supported Rust Version from Cargo.toml
2820

29-
echo "Finished provisioning"
30-
touch /tmp/ready
21+
outputs:
22+
msrv:
23+
description: The MSRV extracted from Cargo.toml
24+
value: ${{ steps.get-msrv.outputs.msrv }}
3125

32-
echo "Print logs"
33-
tail -f $SPARK_HOME/logs/*
26+
runs:
27+
using: composite
28+
steps:
29+
- name: Get MSRV
30+
id: get-msrv
31+
shell: bash
32+
run: |
33+
msrv=$(grep '^rust-version' Cargo.toml | sed 's/.*"\(.*\)".*/\1/')
34+
echo "msrv=$msrv" >> $GITHUB_OUTPUT
35+
echo "MSRV is $msrv"

.github/workflows/ci.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,6 @@ concurrency:
4040
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event_name }}
4141
cancel-in-progress: true
4242

43-
env:
44-
rust_msrv: "1.87"
45-
4643
jobs:
4744
check:
4845
runs-on: ${{ matrix.os }}
@@ -184,10 +181,13 @@ jobs:
184181
uses: arduino/setup-protoc@v3
185182
with:
186183
repo-token: ${{ secrets.GITHUB_TOKEN }}
184+
- name: Get MSRV
185+
id: get-msrv
186+
uses: ./.github/actions/get-msrv
187187
- name: Setup MSRV Rust toolchain
188188
uses: ./.github/actions/setup-builder
189189
with:
190-
rust-version: ${{ env.rust_msrv }}
190+
rust-version: ${{ steps.get-msrv.outputs.msrv }}
191191
- name: Setup Nightly Rust toolchain
192192
uses: ./.github/actions/setup-builder
193193
- name: Check MSRV

.github/workflows/publish.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,6 @@ on:
2626
- "v[0-9]+.[0-9]+.[0-9]+-rc.[0-9]+"
2727
workflow_dispatch:
2828

29-
env:
30-
rust_msrv: "1.87"
31-
3229
jobs:
3330
publish:
3431
runs-on: ubuntu-latest
@@ -48,10 +45,14 @@ jobs:
4845
steps:
4946
- uses: actions/checkout@v6
5047

48+
- name: Get MSRV
49+
id: get-msrv
50+
uses: ./.github/actions/get-msrv
51+
5152
- name: Setup Rust toolchain
5253
uses: ./.github/actions/setup-builder
5354
with:
54-
rust-version: ${{ env.rust_msrv }}
55+
rust-version: ${{ steps.get-msrv.outputs.msrv }}
5556

5657
- name: Publish ${{ matrix.package }}
5758
working-directory: ${{ matrix.package }}

.github/workflows/release_python.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,6 @@ on:
2424
- completed
2525
workflow_dispatch:
2626

27-
env:
28-
rust_msrv: "1.87"
29-
3027
concurrency:
3128
group: ${{ github.workflow }}-${{ github.event.workflow_run.head_branch }}-${{ github.event_name }}
3229
cancel-in-progress: true
@@ -147,10 +144,14 @@ jobs:
147144
- uses: actions/setup-python@v6
148145
with:
149146
python-version: 3.12
147+
- name: Get MSRV
148+
id: get-msrv
149+
uses: ./.github/actions/get-msrv
150+
150151
- name: Setup Rust toolchain
151152
uses: ./.github/actions/setup-builder
152153
with:
153-
rust-version: ${{ env.rust_msrv }}
154+
rust-version: ${{ steps.get-msrv.outputs.msrv }}
154155
- uses: PyO3/maturin-action@v1
155156
with:
156157
target: ${{ matrix.target }}

.github/workflows/release_python_nightly.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,6 @@ on:
2222
- cron: "0 0 * * *" # Runs at midnight UTC every day
2323
workflow_dispatch: # Allows manual triggering
2424

25-
env:
26-
rust_msrv: "1.87"
27-
2825
permissions:
2926
contents: read
3027

@@ -88,10 +85,14 @@ jobs:
8885
with:
8986
python-version: 3.12
9087

88+
- name: Get MSRV
89+
id: get-msrv
90+
uses: ./.github/actions/get-msrv
91+
9192
- name: Setup Rust toolchain
9293
uses: ./.github/actions/setup-builder
9394
with:
94-
rust-version: ${{ env.rust_msrv }}
95+
rust-version: ${{ steps.get-msrv.outputs.msrv }}
9596

9697
- uses: PyO3/maturin-action@v1
9798
with:

Cargo.lock

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/iceberg/src/spec/snapshot.rs

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ pub(super) mod _serde {
272272

273273
#[derive(Debug, Serialize, Deserialize, PartialEq, Eq)]
274274
#[serde(rename_all = "kebab-case")]
275-
/// Defines the structure of a v2 snapshot for serialization/deserialization
275+
/// Defines the structure of a v3 snapshot for serialization/deserialization
276276
pub(crate) struct SnapshotV3 {
277277
pub snapshot_id: i64,
278278
#[serde(skip_serializing_if = "Option::is_none")]
@@ -283,8 +283,10 @@ pub(super) mod _serde {
283283
pub summary: Summary,
284284
#[serde(skip_serializing_if = "Option::is_none")]
285285
pub schema_id: Option<SchemaId>,
286-
pub first_row_id: u64,
287-
pub added_rows: u64,
286+
#[serde(skip_serializing_if = "Option::is_none")]
287+
pub first_row_id: Option<u64>,
288+
#[serde(skip_serializing_if = "Option::is_none")]
289+
pub added_rows: Option<u64>,
288290
#[serde(skip_serializing_if = "Option::is_none")]
289291
pub key_id: Option<String>,
290292
}
@@ -333,10 +335,13 @@ pub(super) mod _serde {
333335
summary: s.summary,
334336
schema_id: s.schema_id,
335337
encryption_key_id: s.key_id,
336-
row_range: Some(SnapshotRowRange {
337-
first_row_id: s.first_row_id,
338-
added_rows: s.added_rows,
339-
}),
338+
row_range: match (s.first_row_id, s.added_rows) {
339+
(Some(first_row_id), Some(added_rows)) => Some(SnapshotRowRange {
340+
first_row_id,
341+
added_rows,
342+
}),
343+
_ => None,
344+
},
340345
}
341346
}
342347
}
@@ -345,12 +350,10 @@ pub(super) mod _serde {
345350
type Error = Error;
346351

347352
fn try_from(s: Snapshot) -> Result<Self, Self::Error> {
348-
let row_range = s.row_range.ok_or_else(|| {
349-
Error::new(
350-
crate::ErrorKind::DataInvalid,
351-
"v3 Snapshots must have first-row-id and rows-added fields set.".to_string(),
352-
)
353-
})?;
353+
let (first_row_id, added_rows) = match s.row_range {
354+
Some(row_range) => (Some(row_range.first_row_id), Some(row_range.added_rows)),
355+
None => (None, None),
356+
};
354357

355358
Ok(SnapshotV3 {
356359
snapshot_id: s.snapshot_id,
@@ -360,8 +363,8 @@ pub(super) mod _serde {
360363
manifest_list: s.manifest_list,
361364
summary: s.summary,
362365
schema_id: s.schema_id,
363-
first_row_id: row_range.first_row_id,
364-
added_rows: row_range.added_rows,
366+
first_row_id,
367+
added_rows,
365368
key_id: s.encryption_key_id,
366369
})
367370
}

0 commit comments

Comments
 (0)