<commit_before>package org.apache.derby.impl.sql.compile;

import org.apache.derby.iapi.error.StandardException;
import org.apache.derby.iapi.reference.ClassName;
import org.apache.derby.iapi.services.classfile.VMOpcode;
import org.apache.derby.iapi.services.compiler.MethodBuilder;
import org.apache.derby.iapi.sql.ResultColumnDescriptor;
import org.apache.derby.iapi.sql.ResultDescription;
import org.apache.derby.iapi.sql.compile.Visitor;
import org.apache.derby.iapi.types.DataTypeDescriptor;
import org.apache.derby.iapi.types.TypeId;
import org.apache.derby.impl.sql.GenericColumnDescriptor;

import java.util.List;

/**
 * Export Node
 * <p/>
 * EXAMPLE: export select a, b, sqrt(c) from table1 where a > 100;
 */
public class ExportNode extends DMLStatementNode {

    private StatementNode node;
    /* HDFS, local, etc */
    private String exportPath;
    private String fileSystem;
    private int replicationCount;
    private String encoding;
    private String fieldSeparator;
    private String quoteCharacter;

    @Override
    int activationKind() {
        return StatementNode.NEED_NOTHING_ACTIVATION;
    }

    @Override
    public String statementToString() {
        return "Export";
    }

    @Override
    public void init(Object statementNode, Object argumentsVector) {
        List argsList = (List) argumentsVector;
        this.node = (StatementNode) statementNode;
        try {
            this.fileSystem = stringValue(argsList.get(0));
            this.exportPath = stringValue(argsList.get(1));
            this.replicationCount = intValue(argsList.get(2));
            this.encoding = stringValue(argsList.get(3));
            this.fieldSeparator = stringValue(argsList.get(4));
            this.quoteCharacter = stringValue(argsList.get(5));
        } catch (StandardException e) {
            throw new RuntimeException(e);
        }
    }

    @Override
    public void optimizeStatement() throws StandardException {
        node.optimizeStatement();
    }

    @Override
    public void bindStatement() throws StandardException {
        node.bindStatement();
    }

    @Override
    public void generate(ActivationClassBuilder acb, MethodBuilder mb) throws StandardException {<commit_msg>DB-1635: Make export parameter order match my docs/plan.<commit_after>package org.apache.derby.impl.sql.compile;

import org.apache.derby.iapi.error.StandardException;
import org.apache.derby.iapi.reference.ClassName;
import org.apache.derby.iapi.services.classfile.VMOpcode;
import org.apache.derby.iapi.services.compiler.MethodBuilder;
import org.apache.derby.iapi.sql.ResultColumnDescriptor;
import org.apache.derby.iapi.sql.ResultDescription;
import org.apache.derby.iapi.sql.compile.Visitor;
import org.apache.derby.iapi.types.DataTypeDescriptor;
import org.apache.derby.iapi.types.TypeId;
import org.apache.derby.impl.sql.GenericColumnDescriptor;

import java.util.List;

/**
 * Export Node
 * <p/>
 * EXAMPLE: export select a, b, sqrt(c) from table1 where a > 100;
 */
public class ExportNode extends DMLStatementNode {

    private StatementNode node;
    /* HDFS, local, etc */
    private String exportPath;
    private String fileSystem;
    private int replicationCount;
    private String encoding;
    private String fieldSeparator;
    private String quoteCharacter;

    @Override
    int activationKind() {
        return StatementNode.NEED_NOTHING_ACTIVATION;
    }

    @Override
    public String statementToString() {
        return "Export";
    }

    @Override
    public void init(Object statementNode, Object argumentsVector) {
        List argsList = (List) argumentsVector;
        this.node = (StatementNode) statementNode;
        try {
            this.exportPath = stringValue(argsList.get(0));
            this.fileSystem = stringValue(argsList.get(1));
            this.replicationCount = intValue(argsList.get(2));
            this.encoding = stringValue(argsList.get(3));
            this.fieldSeparator = stringValue(argsList.get(4));
            this.quoteCharacter = stringValue(argsList.get(5));
        } catch (StandardException e) {
            throw new RuntimeException(e);
        }
    }

    @Override
    public void optimizeStatement() throws StandardException {
        node.optimizeStatement();
    }

    @Override
    public void bindStatement() throws StandardException {
        node.bindStatement();
    }

    @Override
    public void generate(ActivationClassBuilder acb, MethodBuilder mb) throws StandardException {
{'fraction_non_alphanumeric': 0.09718216108276015, 'fraction_numerical': 0.005325049922343022, 'mean_word_length': 3.3221476510067114, 'pattern_counts': {'":': 0, '<': 5, '<?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': '6438508', 'n_tokens_mistral': 1289, 'n_tokens_neox': 1257, 'n_words': 275}