Optional<TableHandle> remoteTableHandle = metadataManager.getTableHandle(remoteTableName);
checkState(remoteTableHandle.isPresent(), "Table %s does not exist", remoteTableName);
Optional<String> remoteConnectorId = metadataManager.getConnectorId(remoteTableHandle.get());
checkArgument(remoteConnectorId.isPresent(), "Table %s can not be aliased", remoteTableName);
TableAlias tableAlias = new TableAlias(remoteConnectorId.get(),
remoteTableName.getSchemaName(),
remoteTableName.getTableName(),
aliasConnectorId.get(),
aliasTableName.getSchemaName(),
aliasTableName.getTableName());