Skip to content

Commit

Permalink
apache#2450 update unit test by comments
Browse files Browse the repository at this point in the history
  • Loading branch information
ryan02.yang committed Mar 12, 2024
1 parent e2090d9 commit 28e3cd3
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -323,14 +323,16 @@ void testAlterTableRenameColumn() {
createSimpleTable(tableName);
checkTableColumns(tableName, simpleTableColumns, getTableInfo(tableName));

String oldColumnName = "age";
String newColumnName = "new_age";
String oldColumnName = "col1";
String newColumnName = "col2";

sql(
String.format(
"ALTER TABLE %S ADD COLUMNS (col1 int)", tableName));
sql(
String.format(
"ALTER TABLE %S RENAME COLUMN %S TO %S", tableName, oldColumnName, newColumnName));
ArrayList<SparkColumnInfo> renameColumns = new ArrayList<>(simpleTableColumns);
renameColumns.remove(SparkColumnInfo.of(oldColumnName, DataTypes.IntegerType, null));
renameColumns.add(SparkColumnInfo.of(newColumnName, DataTypes.IntegerType, null));
checkTableColumns(tableName, renameColumns, getTableInfo(tableName));
}
Expand Down

0 comments on commit 28e3cd3

Please sign in to comment.