class ReduceTableEngine implements TableEngine {
    /** */
    private static final ThreadLocal<ReduceTableWrapper> CREATED_TBL = new ThreadLocal<>();

    /**
     * Create merge table over the given connection with provided index.
     *
     * @param conn Connection.
     * @param idx Index.
     * @return Created table.
     */
    public static ReduceTableWrapper create(Connection conn, int idx) {
        try (Statement stmt = conn.createStatement()) {
            stmt.executeUpdate("CREATE TABLE " + mergeTableIdentifier(idx) +
                "(fake BOOL) ENGINE \"" + ReduceTableEngine.class.getName() + '"');
        }
        catch (SQLException e) {
            throw new IllegalStateException(e);
        }

        ReduceTableWrapper tbl = CREATED_TBL.get();

        assert tbl != null;

        CREATED_TBL.remove();

        return tbl;
    }

    /** {@inheritDoc} */
    @Override public Table createTable(CreateTableData d) {<FILL_FUNCTION_BODY>}
}

        assert CREATED_TBL.get() == null;

        ReduceTableWrapper tbl = new ReduceTableWrapper(
            d.schema,
            d.id,
            d.tableName,
            d.persistIndexes,
            d.persistData
        );

        CREATED_TBL.set(tbl);

        return tbl;
    
<no_super_class>