<commit_before>package org.jkiss.dbeaver.ext.db2.tasks;

import org.jkiss.code.NotNull;
import org.jkiss.dbeaver.ext.db2.model.DB2TableBase;
import org.jkiss.dbeaver.model.DBPEvaluationContext;
import org.jkiss.dbeaver.model.edit.DBEPersistAction;
import org.jkiss.dbeaver.model.exec.DBCException;
import org.jkiss.dbeaver.model.exec.DBCSession;
import org.jkiss.dbeaver.model.impl.edit.SQLDatabasePersistAction;

import java.util.List;

import static org.jkiss.utils.CommonUtils.getLineSeparator;

public class DB2RunstatsTool extends DB2ToolWithStatus<DB2TableBase, DB2RunstatsToolSettings>{

    @NotNull
    @Override
    public DB2RunstatsToolSettings createToolSettings() {
        return new DB2RunstatsToolSettings();
    }

    @Override
    public void generateObjectQueries(DBCSession session, DB2RunstatsToolSettings settings, List<DBEPersistAction> queries, DB2TableBase object) throws DBCException {
        String sql = "CALL SYSPROC.ADMIN_CMD('";
        sql += "RUNSTATS ON TABLE ";
        sql += object.getFullyQualifiedName(DBPEvaluationContext.DDL);
        sql += getLineSeparator();
        sql += settings.getColumnStat();
        sql += getLineSeparator();
        sql += settings.getIndexStat();

        if (settings.isTableSampling()) {
            sql += String.format("TABLESAMPLE SYSTEM(%d)", settings.getSamplePercent());
        }
//        String tableAccess = settings.getTableAccess();
//        String cleanupOption = settings.getCleanupOption();
//
//        if (tableAccess.equals()) {
//            sb.append(" ALLOW NO ACCESS");
//        }
//        if (tableAccess.equals()) {
//            sb.append(" ALLOW READ ACCESS");
//        }
//        if (tableAccess.equals()) {
//            sb.append(" ALLOW WRITE ACCESS");
//        }
//        if (cleanupOption.equals()) {
//            sb.append(" CLEANUP ALL");
//        }
//        if (cleanupOption.equals()) {
//            sb.append(" CLEANUP PAGES");
//        }
        sql += "')";
        queries.add(new SQLDatabasePersistAction(sql));
    }
}
<commit_msg>deleted excess Line Separator<commit_after>package org.jkiss.dbeaver.ext.db2.tasks;

import org.jkiss.code.NotNull;
import org.jkiss.dbeaver.ext.db2.model.DB2TableBase;
import org.jkiss.dbeaver.model.DBPEvaluationContext;
import org.jkiss.dbeaver.model.edit.DBEPersistAction;
import org.jkiss.dbeaver.model.exec.DBCException;
import org.jkiss.dbeaver.model.exec.DBCSession;
import org.jkiss.dbeaver.model.impl.edit.SQLDatabasePersistAction;

import java.util.List;

import static org.jkiss.utils.CommonUtils.getLineSeparator;

public class DB2RunstatsTool extends DB2ToolWithStatus<DB2TableBase, DB2RunstatsToolSettings>{

    @NotNull
    @Override
    public DB2RunstatsToolSettings createToolSettings() {
        return new DB2RunstatsToolSettings();
    }

    @Override
    public void generateObjectQueries(DBCSession session, DB2RunstatsToolSettings settings, List<DBEPersistAction> queries, DB2TableBase object) throws DBCException {
        String sql = "CALL SYSPROC.ADMIN_CMD('";
        sql += "RUNSTATS ON TABLE ";
        sql += object.getFullyQualifiedName(DBPEvaluationContext.DDL);
        sql += getLineSeparator();
        sql += settings.getColumnStat();
        sql += settings.getIndexStat();

        if (settings.isTableSampling()) {
            sql += String.format(" TABLESAMPLE SYSTEM(%d)", settings.getSamplePercent());
        }
        sql += "')";
        queries.add(new SQLDatabasePersistAction(sql));
    }
}

{'fraction_non_alphanumeric': 0.12039942938659058, 'fraction_numerical': 0.006276747503566334, 'mean_word_length': 3.2496969696969695, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5048353', 'n_tokens_mistral': 1075, 'n_tokens_neox': 1072, 'n_words': 186}