public static CatalogTable of(TableIdentifier tableId, CatalogTable catalogTable) {
        CatalogTable newTable = catalogTable.copy();
        return new CatalogTable(
                tableId,
                newTable.getTableSchema(),
                newTable.getOptions(),
                newTable.getPartitionKeys(),
                newTable.getComment(),
                newTable.getCatalogName());
    }
@Test
    public void testCatalogTableWithIllegalFieldNames() {
        CatalogTable catalogTable =
                CatalogTable.of(
                        TableIdentifier.of("catalog", "database", "table"),
                        TableSchema.builder()
                                .column(
                                        PhysicalColumn.of(
                                                "  ", BasicType.STRING_TYPE, 1L, true, null, ""))
                                .build(),
                        Collections.emptyMap(),
                        Collections.emptyList(),
                        "comment");
        SeaTunnelException exception =
                Assertions.assertThrows(
                        SeaTunnelException.class,
                        () ->
                                new TableTransformFactoryContext(
                                        Collections.singletonList(catalogTable), null, null));
        SeaTunnelException exception2 =
                Assertions.assertThrows(
                        SeaTunnelException.class,
                        () -> new TableSinkFactoryContext(catalogTable, null, null));
        Assertions.assertEquals(
                "Table database.table field name cannot be empty", exception.getMessage());
        Assertions.assertEquals(
                "Table database.table field name cannot be empty", exception2.getMessage());

        CatalogTable catalogTable2 =
                CatalogTable.of(
                        TableIdentifier.of("catalog", "database", "table"),
                        TableSchema.builder()
                                .column(
                                        PhysicalColumn.of(
                                                "name1", BasicType.STRING_TYPE, 1L, true, null, ""))
                                .column(
                                        PhysicalColumn.of(
                                                "name1", BasicType.STRING_TYPE, 1L, true, null, ""))
                                .build(),
                        Collections.emptyMap(),
                        Collections.emptyList(),
                        "comment");
        SeaTunnelException exception3 =
                Assertions.assertThrows(
                        SeaTunnelException.class,
                        () ->
                                new TableTransformFactoryContext(
                                        Collections.singletonList(catalogTable2), null, null));
        SeaTunnelException exception4 =
                Assertions.assertThrows(
                        SeaTunnelException.class,
                        () -> new TableSinkFactoryContext(catalogTable2, null, null));
        Assertions.assertEquals(
                "Table database.table field name1 duplicate", exception3.getMessage());
        Assertions.assertEquals(
                "Table database.table field name1 duplicate", exception4.getMessage());
    }