@VisibleForTesting
    static Session.SessionBuilder transferSessionPropertiesToSession(Session.SessionBuilder session, Map<String, String> sessionProperties)
    {
        sessionProperties.forEach((key, value) -> {
            // Presto session properties may also contain catalog properties in format catalog.property_name=value
            String[] parts = key.split("\\.");
            if (parts.length == 1) {
                // system property
                session.setSystemProperty(parts[0], value);
            }
            else if (parts.length == 2) {
                // catalog property
                session.setCatalogSessionProperty(parts[0], parts[1], value);
            }
            else {
                throw new PrestoException(INVALID_SESSION_PROPERTY, "Unable to parse session property: " + key);
            }
        });

        return session;
    }
@Test
    public void testTransferSessionProperties()
    {
        Session.SessionBuilder sessionBuilder = TestingSession.testSessionBuilder();
        Map<String, String> sessionProperties = ImmutableMap.of(
                "property_name", "property_value",
                "catalog.property_name", "value2");

        Session result = transferSessionPropertiesToSession(sessionBuilder, sessionProperties).build();

        assertEquals(result.getSystemProperties().get("property_name"), "property_value");
        assertEquals(result.getUnprocessedCatalogProperties().get("catalog").get("property_name"), "value2");
    }