155
155
import static io .trino .plugin .hive .metastore .MetastoreUtil .verifyCanDropColumn ;
156
156
import static io .trino .plugin .hive .metastore .glue .v1 .AwsSdkUtil .getPaginatedResults ;
157
157
import static io .trino .plugin .hive .metastore .glue .v1 .converter .GlueInputConverter .convertFunction ;
158
+ import static io .trino .plugin .hive .metastore .glue .v1 .converter .GlueInputConverter .convertGlueTableToTableInput ;
158
159
import static io .trino .plugin .hive .metastore .glue .v1 .converter .GlueInputConverter .convertPartition ;
159
160
import static io .trino .plugin .hive .metastore .glue .v1 .converter .GlueToTrinoConverter .getTableParameters ;
160
161
import static io .trino .plugin .hive .metastore .glue .v1 .converter .GlueToTrinoConverter .getTableType ;
161
- import static io .trino .plugin .hive .metastore .glue .v1 .converter .GlueToTrinoConverter .getTableTypeNullable ;
162
162
import static io .trino .plugin .hive .metastore .glue .v1 .converter .GlueToTrinoConverter .mappedCopy ;
163
163
import static io .trino .plugin .hive .util .HiveUtil .escapeSchemaName ;
164
164
import static io .trino .spi .StandardErrorCode .ALREADY_EXISTS ;
@@ -510,7 +510,7 @@ public void renameTable(String databaseName, String tableName, String newDatabas
510
510
GetTableRequest getTableRequest = new GetTableRequest ().withDatabaseName (databaseName )
511
511
.withName (tableName );
512
512
GetTableResult glueTable = glueClient .getTable (getTableRequest );
513
- TableInput tableInput = convertGlueTableToTableInput (glueTable .getTable (), newTableName );
513
+ TableInput tableInput = convertGlueTableToTableInput (glueTable .getTable ()). withName ( newTableName );
514
514
CreateTableRequest createTableRequest = new CreateTableRequest ()
515
515
.withDatabaseName (newDatabaseName )
516
516
.withTableInput (tableInput );
@@ -533,24 +533,6 @@ public void renameTable(String databaseName, String tableName, String newDatabas
533
533
}
534
534
}
535
535
536
- private static TableInput convertGlueTableToTableInput (com .amazonaws .services .glue .model .Table glueTable , String newTableName )
537
- {
538
- return new TableInput ()
539
- .withName (newTableName )
540
- .withDescription (glueTable .getDescription ())
541
- .withOwner (glueTable .getOwner ())
542
- .withLastAccessTime (glueTable .getLastAccessTime ())
543
- .withLastAnalyzedTime (glueTable .getLastAnalyzedTime ())
544
- .withRetention (glueTable .getRetention ())
545
- .withStorageDescriptor (glueTable .getStorageDescriptor ())
546
- .withPartitionKeys (glueTable .getPartitionKeys ())
547
- .withViewOriginalText (glueTable .getViewOriginalText ())
548
- .withViewExpandedText (glueTable .getViewExpandedText ())
549
- .withTableType (getTableTypeNullable (glueTable ))
550
- .withTargetTable (glueTable .getTargetTable ())
551
- .withParameters (getTableParameters (glueTable ));
552
- }
553
-
554
536
@ Override
555
537
public void commentTable (String databaseName , String tableName , Optional <String > comment )
556
538
{
0 commit comments