arnaudbriche commented on code in PR #307: URL: https://github.com/apache/iceberg-go/pull/307#discussion_r1960562598
########## utils.go: ########## @@ -238,3 +239,68 @@ func avroEncode[T any](key string, version int, vals []T, out io.Writer) error { return enc.Close() } + +func structTypeToAvroPartitionSchema(st *StructType) (avro.Schema, error) { + var aFields []*avro.Field + + for _, field := range st.Fields() { + aField, err := nestedFieldToAvroField(field) + + if err != nil { + return nil, err + } + + aFields = append(aFields, aField) + } + + return avro.NewRecordSchema("r102", "", aFields) Review Comment: Here is how Pyiceberg derive the record name: https://github.com/apache/iceberg-python/blob/efc8b5ac0f16717f776e034ecf9a9e9bdabd8424/pyiceberg/utils/schema_conversion.py#L543 ########## utils.go: ########## @@ -238,3 +239,68 @@ func avroEncode[T any](key string, version int, vals []T, out io.Writer) error { return enc.Close() } + +func structTypeToAvroPartitionSchema(st *StructType) (avro.Schema, error) { + var aFields []*avro.Field + + for _, field := range st.Fields() { + aField, err := nestedFieldToAvroField(field) + + if err != nil { + return nil, err + } + + aFields = append(aFields, aField) + } + + return avro.NewRecordSchema("r102", "", aFields) Review Comment: Here is how Pyiceberg derives the record name: https://github.com/apache/iceberg-python/blob/efc8b5ac0f16717f776e034ecf9a9e9bdabd8424/pyiceberg/utils/schema_conversion.py#L543 -- 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: issues-unsubscr...@iceberg.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org For additional commands, e-mail: issues-h...@iceberg.apache.org