sgg commented on code in PR #2660:
URL: https://github.com/apache/iceberg-go/pull/2660#discussion_r4744606140
##########
table/replace_sort_order_builder.go:
##########
@@ -53,23 +53,17 @@ func NewReplaceSortOrderBuilder(t *Transaction,
caseSensitive bool) *ReplaceSort
}
// Asc adds a column sorted in ascending order with the requested null
ordering.
-// Go writers currently support only top-level sort columns; appending data
with
-// a nested-field sort order fails until the order is replaced.
func (u *ReplaceSortOrderBuilder) Asc(column string, nullOrder NullOrder)
*ReplaceSortOrderBuilder {
return u.AddField(column, iceberg.IdentityTransform{}, SortASC,
nullOrder)
}
// Desc adds a column sorted in descending order with the requested null
ordering.
-// Go writers currently support only top-level sort columns; appending data
with
-// a nested-field sort order fails until the order is replaced.
func (u *ReplaceSortOrderBuilder) Desc(column string, nullOrder NullOrder)
*ReplaceSortOrderBuilder {
return u.AddField(column, iceberg.IdentityTransform{}, SortDESC,
nullOrder)
}
// AddField adds a transformed sort field. A nil or incompatible transform is
-// rejected when the replacement is applied or committed. Go writers currently
-// support only top-level sort columns; appending data with a nested-field sort
-// order fails until the order is replaced.
+// rejected when the replacement is applied or committed.
Review Comment:
So I did some spelunking and basically the state with this PR (allowing
specs but failing writes) matches the other implementations.
I'm reluctant to make Go _more strict_ than other implementations so I'm
going to restore those caveats and improve the error message.
Please let me know if that doesn't work.
Details:
* The
[spec](https://github.com/apache/iceberg/blob/8c5f2d843af1612e5231ec6d52c73272548d9497/format/spec.md#sorting)
doesn't explicitly forbid sort columns under lists/maps.
* Iceberg Java and C++ **allow** tables to define sort columns under
lists/maps.
* AFAICT Flink and Spark **do not support** writing with this sort order and
will return errors.
This smells like a gap in the spec and is worth a follow up on the mailing
list.
--
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]