bbiiaaoo commented on code in PR #10637:
URL: https://github.com/apache/gravitino/pull/10637#discussion_r3207156304
##########
lance/lance-common/src/main/java/org/apache/gravitino/lance/common/ops/gravitino/GravitinoLanceTableAlterHandler.java:
##########
@@ -115,21 +115,20 @@ public AlterTableAlterColumnsResponse handle(
}
private TableChange[]
buildAlterColumnChanges(AlterTableAlterColumnsRequest request) {
- List<ColumnAlteration> columns = request.getAlterations();
+ List<AlterColumnsEntry> columns = request.getAlterations();
List<TableChange> changes = new ArrayList<>();
- for (ColumnAlteration column : columns) {
+ for (AlterColumnsEntry column : columns) {
// Column name will not be null according to LanceDB spec.
- String columnName = column.getColumn();
+ String columnName = column.getPath();
String newName = column.getRename();
if (StringUtils.isNotBlank(newName)) {
changes.add(TableChange.renameColumn(new String[] {columnName},
newName));
}
- // The format of ColumnAlteration#castTo is unclear, so we will skip
it now
- // for more, please refer to: https://shorturl.at/bYI0Z (short url for
- // github.com/lance-format/lance-namespace)
- if (StringUtils.isNotBlank(column.getCastTo())) {
+ if (column.getDataType() != null
+ || column.getNullable() != null
+ || column.getVirtualColumn() != null) {
Review Comment:
No, these fields are optional. Currently Gravitino only supports rename, so
the check rejects the request if dataType, nullable, or virtualColumn is set. I
updated the helper and error message to make this clearer.
--
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]