@Test(expected=JoinToSelfException.class)
public void joinToSelf() throws StandardException {

    String sql = "CREATE TABLE t(id1 INT PRIMARY KEY, id2 INT, GROUPING FOREIGN KEY(id2) REFERENCES t(id1))";
    StatementNode stmt = parser.parseStatement(sql);
    TableDDL.createTable(ddlFunctions, null, DEFAULT_SCHEMA, (CreateTableNode)stmt, null);
}