import java.io.File;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collector;
import org.apache.flink.api.common.functions.FlatMapFunction;
import org.apache.flink.api.java.DataSet;
import org.apache.flink.api.java.ExecutionEnvironment;
import org.apache.flink.api.java.tuple.Tuple1;
import org.apache.flink.api.java.utils.ParameterTool;
public class ReadFiles {
/**
* @param args
*/
public static void main(String[] args) throws Exception {
// set up the execution environment
try {
final ParameterTool params = ParameterTool.fromArgs(args);
final ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment();
env.setParallelism(1); // without this multiple files creating
env.getConfig().setGlobalJobParameters(params);
List<String> paths = new ArrayList<String>();
File dir = new File(params.getRequired("input"));
for (File f : dir.listFiles()) {
if (f.isFile()) {
paths.add(f.getName());
}
}
DataSet<String> data = env.fromCollection(paths).rebalance();
DataSet<Tuple1<String>> output = data.flatMap(new CSVSplitter());
env.execute();
} catch (Exception e) {
e.printStackTrace();
}
}
}
And the syntax to build bazel which I am trying -
bazel build FlinkEx/com/practice:read_files
facing issues after executing this.
Worker process sent response with exit code: 1.
error: wrong number of type arguments; required 3
Bazel build only builds the code into an executable form. Bazel run will actually run the executable, and any arguments will be passed in to the binary.
Can you share your repository or at least the BUILD file so we can see what is happening to cause that error message?
--
You received this message because you are subscribed to the Google Groups "bazel-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bazel-discus...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/bazel-discuss/cb2583e1-f1d1-4002-aa83-dd743b767f8e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
To view this discussion on the web visit https://groups.google.com/d/msgid/bazel-discuss/402df96e-8a68-43d5-b213-068bf6172d8a%40googlegroups.com.