badalprasadsingh commented on code in PR #1214:
URL: https://github.com/apache/iceberg-go/pull/1214#discussion_r3528777822


##########
table/data_file_meta.go:
##########
@@ -0,0 +1,349 @@
+// 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.
+
+package table
+
+import (
+       "errors"
+       "fmt"
+
+       "github.com/apache/arrow-go/v18/parquet/metadata"
+       "github.com/apache/iceberg-go"
+       tblutils "github.com/apache/iceberg-go/table/internal"
+)
+
+// DataFileArgs collects everything needed to compute a fully populated
+// [iceberg.DataFile] (data, equality-delete, or positional-delete) from
+// a file's in-memory, format-specific metadata object without performing
+// any filesystem reads.
+type DataFileArgs struct {
+       // Schema is the Iceberg schema the file's contents conform to.
+       // Per-column statistics are matched by leaf-column path: each file
+       // column's dotted path MUST equal the path derived from this schema's
+       // field names. Embedded field-id metadata in the file (e.g. the Parquet
+       // "PARQUET:field_id" key) is not consulted, so a column renamed 
relative
+       // to the file will not resolve.
+       Schema *iceberg.Schema
+
+       // Spec is the partition spec the resulting DataFile is bound to —
+       // typically tbl.Spec(). The zero value [iceberg.PartitionSpec]{} is
+       // equivalent to *iceberg.UnpartitionedSpec and is accepted for
+       // unpartitioned tables.
+       Spec iceberg.PartitionSpec
+
+       // Format identifies the on-disk file format and selects the internal
+       // FileFormat implementation used to extract per-column statistics from
+       // Metadata. It must match the concrete type of Metadata: the only 
supported
+       // combination today is [iceberg.ParquetFile] with a 
*metadata.FileMetaData.
+       Format iceberg.FileFormat
+
+       // Metadata is the format-specific, in-memory file metadata object 
produced
+       // by the external writer.
+       //
+       // Today only Format == [iceberg.ParquetFile] with 
*metadata.FileMetaData is supported
+       Metadata any
+
+       // FilePath is the fully qualified location the file bytes were
+       // written to (the same path that will be recorded in the manifest 
entry).
+       FilePath string
+
+       // FileSize is the byte length of the object at FilePath. Must be
+       // greater than zero.
+       FileSize int64
+
+       // Content selects which manifest-entry kind to produce — one of
+       // [iceberg.EntryContentData], [iceberg.EntryContentEqDeletes] or
+       // [iceberg.EntryContentPosDeletes].
+       Content iceberg.ManifestEntryContent
+
+       // PartitionValues maps spec field ID → partition value. Every spec 
field
+       // must be present; leave nil/empty for unpartitioned tables, where any
+       // supplied value is rejected.
+       //
+       // Values must already be the transform results in the expected Go 
types.
+       // A nil value is treated as "not supplied" and is inferred from the 
file's
+       // column statistics; void-transform fields therefore should be nil (the
+       // void transform always yields null), though this is not enforced.

Review Comment:
   Done.
   
   1. Now, ignoring the `key` or supplying the key with `nil` value behaves the 
same - not supplied by the user.
   2. Updated the spec as well.



-- 
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