@Test
public void shouldBeAbleToCreateAndExecuteJcrSql2QueryWithDescendantNodeJoinWithoutCriteria() throws RepositoryException {

    // The 'all' selector will find all nodes, including '/Car' and '/Car/Sports'. Thus,
    // '/Car/Sports/Infiniti G37' will be a descendant of both '/Car' and '/Car/Sports', and thus will appear
    // once joined with '/Car' and once joined with '/Car/Sports'. These two tuples will be similar, but they are
    // actually not repeats (since the columns from 'all' will be different).
    String sql = "SELECT * FROM [car:Car] as car JOIN [nt:unstructured] as all ON ISDESCENDANTNODE(car,all)";
    Query query = session.getWorkspace().getQueryManager().createQuery(sql, Query.JCR_SQL2);
    QueryResult result = query.execute();
    String[] columnNames = allOf(carColumnNames("car"), allColumnNames("all"));
    validateQuery().rowCount(26).hasColumns(columnNames).validate(query, result);
}