presto-main/src/main/java/io/prestosql/metadata/MetadataManager.java/MetadataManager/applySample
class MetadataManager:    @Override
    public Optional<TableHandle> applySample(Session session, TableHandle table, SampleType sampleType, double sampleRatio)
    {
        CatalogName catalogName = table.getCatalogName();
        ConnectorMetadata metadata = getMetadata(session, catalogName);

        if (metadata.usesLegacyTableLayouts()) {
            return Optional.empty();
        }

        ConnectorSession connectorSession = session.toConnectorSession(catalogName);
        return metadata.applySample(connectorSession, table.getConnectorHandle(), sampleType, sampleRatio)
                .map(result -> new TableHandle(
                        catalogName,
                        result,
                        table.getTransaction(),
                        Optional.empty()));
    }