laskoviymishka commented on code in PR #28:
URL: 
https://github.com/apache/iceberg-verification/pull/28#discussion_r4596733562


##########
reference-tables/v3/initial-default-parquet-data/expected/scan.json:
##########
@@ -0,0 +1,20 @@
+{
+  "snapshots": [
+    {
+      "snapshot-id": "7114932894542774710",

Review Comment:
   Could we drop the snapshot 1 entry and put the README back to "a struct of 
the table schema" 
([L219-L221](https://github.com/apache/iceberg-verification/blob/d4234054128ac7a2fbe554e7fde79522ff6fb6b8/reference-tables/README.md#L219-L221),
 
[L240-L244](https://github.com/apache/iceberg-verification/blob/d4234054128ac7a2fbe554e7fde79522ff6fb6b8/reference-tables/README.md#L240-L244))?
 The spec doesn't say which schema a scan at an earlier snapshot projects: 
[Point in Time 
Reads](https://github.com/apache/iceberg/blob/e10447250d41872e7f6c44a035b88c9490c2be43/format/spec.md?plain=1#L2471-L2476)
 only says to "use the metadata from that snapshot", and [snapshot 
`schema-id`](https://github.com/apache/iceberg/blob/e10447250d41872e7f6c44a035b88c9490c2be43/format/spec.md?plain=1#L1274)
 has no read rule. 
[CONTRIBUTING](https://github.com/apache/iceberg-verification/blob/d4234054128ac7a2fbe554e7fde79522ff6fb6b8/CONTRIBUTING.md#L38-L43)
 asks us to leave that out, and the snapshot 2 entry already 
 covers what the issue asks for.



##########
reference-tables/v3/initial-default-parquet-data/README.md:
##########
@@ -0,0 +1,86 @@
+<!--
+  ~ Licensed to the Apache Software Foundation (ASF) under one
+  ~ or more contributor license agreements.  See the NOTICE file
+  ~ distributed with this work for additional information
+  ~ regarding copyright ownership.  The ASF licenses this file
+  ~ to you under the Apache License, Version 2.0 (the
+  ~ "License"); you may not use this file except in compliance
+  ~ with the License.  You may obtain a copy of the License at
+  ~
+  ~   http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing,
+  ~ software distributed under the License is distributed on an
+  ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  ~ KIND, either express or implied.  See the License for the
+  ~ specific language governing permissions and limitations
+  ~ under the License.
+  -->
+
+# v3/initial-default-parquet-data
+
+Input to `reference-tables/GenerateTables.java`. The schema and partition spec 
are
+the spec's JSON forms. Each commit appends one data file holding its rows, 
written
+in the spec's single-value JSON keyed by field ID, with `long` values as 
strings.
+A commit with `schema-updates` instead applies those updates as one schema 
change:
+`add-column` adds a top-level column with its `initial-default`, which also 
sets
+its `write-default`, and `update-default` changes a column's `write-default`.
+Rows of later commits are written in the evolved schema.
+
+## Input
+
+```json
+{
+  "format-version": 3,
+  "description": "A required int added with an initial-default (42) whose 
write-default is then changed (10), and an optional string added without a 
default, after the first append. Two snapshots, four rows; rows written before 
the change read the initial-default and null.",
+  "schema": {
+    "type": "struct",
+    "schema-id": 0,
+    "fields": [
+      {
+        "id": 1,
+        "name": "id",
+        "required": true,
+        "type": "long"
+      },
+      {
+        "id": 2,
+        "name": "data",
+        "required": false,
+        "type": "string"
+      }
+    ]
+  },
+  "partition-spec": {
+    "spec-id": 0,
+    "fields": []
+  },
+  "commits": [
+    {
+      "data-file": "a",
+      "rows": [
+        {"1": "1", "2": "alpha"},
+        {"1": "2", "2": "bravo"}
+      ]
+    },
+    {
+      "schema-updates": [
+        {"action": "add-column", "name": "quantity", "type": "int", 
"required": true, "initial-default": 42},
+        {"action": "add-column", "name": "note", "type": "string", "required": 
false}

Review Comment:
   Should the Input also cover an optional column with a non-null 
`initial-default`? `note` has none, so its expected null is the same as the 
[spec's 
fallback](https://github.com/apache/iceberg/blob/e10447250d41872e7f6c44a035b88c9490c2be43/format/spec.md?plain=1#L372-L377)
 for optional fields, and a reader that applies `initial-default` only to 
required columns still passes. A row in `b` that omits `quantity` would also 
put `write-default` 10 into the expected output.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to