public Optional<Table> getTable(TableName tableName) {
        return Optional.ofNullable(getTable(tableName.getCatalog(), tableName.getDb(), tableName.getTbl()));
    }
@Test
    public void testGetTable(@Mocked HiveMetaStoreClient metaStoreThriftClient) throws TException {
        List<FieldSchema> partKeys = Lists.newArrayList(new FieldSchema("col1", "BIGINT", ""));
        List<FieldSchema> unPartKeys = Lists.newArrayList(new FieldSchema("col2", "INT", ""));
        String hdfsPath = "hdfs://127.0.0.1:10000/hive";
        StorageDescriptor sd = new StorageDescriptor();
        sd.setCols(unPartKeys);
        sd.setLocation(hdfsPath);
        sd.setInputFormat(MAPRED_PARQUET_INPUT_FORMAT_CLASS);
        Table msTable1 = new Table();
        msTable1.setDbName("hive_db");
        msTable1.setTableName("hive_table");
        msTable1.setPartitionKeys(partKeys);
        msTable1.setSd(sd);
        msTable1.setTableType("MANAGED_TABLE");
        msTable1.setCreateTime(20201010);
        new Expectations() {
            {
                metaStoreThriftClient.getTable("hive_db", "hive_table");
                result = msTable1;
            }
        };

        MetadataMgr metadataMgr = GlobalStateMgr.getCurrentState().getMetadataMgr();

        com.starrocks.catalog.Table internalTable = metadataMgr.getTable("default_catalog", "db1", "tbl1");
        Assert.assertNotNull(internalTable);
        Assert.assertNull(metadataMgr.getTable("default_catalog", "not_exist_db", "xxx"));
        Assert.assertNull(metadataMgr.getTable("default_catalog", "db1", "not_exist_table"));

        com.starrocks.catalog.Table tbl1 = metadataMgr.getTable("hive_catalog", "hive_db", "hive_table");
        Assert.assertNotNull(tbl1);
        Assert.assertEquals("hive_catalog.hive_db.hive_table.20201010", tbl1.getUUID());

        com.starrocks.catalog.Table tbl2 = metadataMgr.getTable("not_exist_catalog", "xxx", "xxx");
        Assert.assertNull(tbl2);

        Assert.assertThrows(StarRocksConnectorException.class,
                () -> metadataMgr.getTable("hive_catalog", "not_exist_db", "xxx"));
        Assert.assertThrows(StarRocksConnectorException.class,
                () -> metadataMgr.getTable("hive_catalog", "hive_db", "not_exist_tbl"));
    }