Search in sources :

Example 1 with GuessExecutor

use of org.embulk.exec.GuessExecutor in project embulk by embulk.

the class FileInputRunner method guess.

public ConfigDiff guess(ConfigSource execConfig, ConfigSource inputConfig) {
    final ConfigSource sampleBufferConfig = createSampleBufferConfigFromExecConfig(execConfig);
    final Buffer sample = SamplingParserPlugin.runFileInputSampling(this, inputConfig, sampleBufferConfig);
    // SamplingParserPlugin.runFileInputSampling throws NoSampleException if there're
    // no files or all files are smaller than minSampleSize (40 bytes).
    GuessExecutor guessExecutor = Exec.getInjector().getInstance(GuessExecutor.class);
    return guessExecutor.guessParserConfig(sample, inputConfig, execConfig);
}
Also used : ConfigSource(org.embulk.config.ConfigSource) GuessExecutor(org.embulk.exec.GuessExecutor)

Aggregations

ConfigSource (org.embulk.config.ConfigSource)1 GuessExecutor (org.embulk.exec.GuessExecutor)1