Hi Greg, print is only eagerly executed for DataSet programs. In the DataStream API, print() just appends a print sink and execute() is required to trigger an execution.
2016-10-06 22:40 GMT+02:00 Greg Hogan <c...@greghogan.com>: > The program executes when you call print (same for collect), which is why > you are seeing an error when calling execute (since there is no new job to > execute). As Fabian noted, you'll need to look in the TaskManager log files > for the printed output if running on a cluster. > > On Thu, Oct 6, 2016 at 4:21 PM, drystan mazur <drystan.ma...@gmail.com> > wrote: > >> Hello I am reading a csv file with flink 1.1.2 the file loads and runs >> but printing shows nothing ? >> >> <code> >> env.setStreamTimeCharacteristic(TimeCharacteristic.EventTime); >> env.setParallelism(1); >> System.out.println(env); >> >> DataStream<Tuple9<String,String,String, >> String,String,String, >> String,String,String>> oilDataStream; >> DataStreamSink oildataSink; >> //String path = >> Paths.get(".").toAbsolutePath().normalize().toString(); >> String path = "/quickstart/test_data/oil_price.csv"; >> >> >> Path oilPath = new Path(path); >> >> >> TupleCsvInputFormat oilDataIn; >> >> TupleTypeInfo<Tuple9<String,String,String, >> String,String,String, >> String,String,String>> oildataTypes; >> >> BasicTypeInfo[] types = >> {BasicTypeInfo.STRING_TYPE_INFO,BasicTypeInfo.STRING_TYPE_INFO,BasicTypeInfo.STRING_TYPE_INFO, >> >> BasicTypeInfo.STRING_TYPE_INFO,BasicTypeInfo.STRING_TYPE_INFO,BasicTypeInfo.STRING_TYPE_INFO, >> >> BasicTypeInfo.STRING_TYPE_INFO,BasicTypeInfo.STRING_TYPE_INFO,BasicTypeInfo.STRING_TYPE_INFO}; >> >> oildataTypes = new TupleTypeInfo<>(types); >> oilDataIn = new TupleCsvInputFormat<>(oilPath,"\n",",",oildataTypes); >> >> >> oilDataStream = env.createInput(oilDataIn,new >> TupleTypeInfo(Tuple9.class, types)); >> oilDataStream.print(); >> >> >> >> >> env.execute("Flink Java API Skeleton"); >> >> >> </code> >> >> The code runs ok I just wanted to view the datastream what I am doing >> wrong ? Thanks >> ------------------------------ >> View this message in context: DataStream csv reading >> <http://apache-flink-user-mailing-list-archive.2336050.n4.nabble.com/DataStream-csv-reading-tp9376.html> >> Sent from the Apache Flink User Mailing List archive. mailing list >> archive >> <http://apache-flink-user-mailing-list-archive.2336050.n4.nabble.com/> >> at Nabble.com. >> > >