@Override
    public ResultSet getClientInfoProperties()
            throws SQLException
    {
        return select(format("SELECT * FROM (VALUES%n" +
                        "        ('ApplicationName', %s, 'presto-jdbc', 'Sets the source of the session'),%n" +
                        "        ('ClientInfo', %s, NULL, 'Sets the client info of the session'),        %n" +
                        "        ('ClientTags', %s, NULL, 'Comma-delimited string of tags for the session'),        %n" +
                        "        ('TraceToken', %s, NULL, 'Sets the trace token of the session')        %n" +
                        ") AS t (NAME, MAX_LEN, DEFAULT_VALUE, DESCRIPTION)",
                MAX_LENGTH,
                MAX_LENGTH,
                MAX_LENGTH,
                MAX_LENGTH));
    }
@Test
    public void testGetClientInfoProperties()
            throws Exception
    {
        try (ResultSet resultSet = connection.getMetaData().getClientInfoProperties()) {
            ResultSetMetaData metadata = resultSet.getMetaData();
            assertEquals(metadata.getColumnCount(), 4);
            assertEquals(metadata.getColumnName(1), "NAME");
            assertEquals(metadata.getColumnName(2), "MAX_LEN");
            assertEquals(metadata.getColumnName(3), "DEFAULT_VALUE");
            assertEquals(metadata.getColumnName(4), "DESCRIPTION");

            assertTrue(resultSet.next());
            assertEquals(resultSet.getString(1), "ApplicationName");
            assertEquals(resultSet.getInt(2), MAX_LENGTH);
            assertEquals(resultSet.getString(3), "presto-jdbc");
            assertEquals(resultSet.getString(4), "Sets the source of the session");

            assertTrue(resultSet.next());
            assertEquals(resultSet.getString(1), "ClientInfo");
            assertEquals(resultSet.getInt(2), MAX_LENGTH);
            assertNull(resultSet.getString(3));
            assertEquals(resultSet.getString(4), "Sets the client info of the session");

            assertTrue(resultSet.next());
            assertEquals(resultSet.getString(1), "ClientTags");
            assertEquals(resultSet.getInt(2), MAX_LENGTH);
            assertNull(resultSet.getString(3));
            assertEquals(resultSet.getString(4), "Comma-delimited string of tags for the session");

            assertTrue(resultSet.next());
            assertEquals(resultSet.getString(1), "TraceToken");
            assertEquals(resultSet.getInt(2), MAX_LENGTH);
            assertNull(resultSet.getString(3));
            assertEquals(resultSet.getString(4), "Sets the trace token of the session");

            assertFalse(resultSet.next());
        }
    }