flink-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Pawan Manishka Gunarathna <pawan.manis...@gmail.com>
Subject Re: [Dev] Issue related to using Flink DataSet<T> methods
Date Wed, 01 Mar 2017 06:16:34 GMT
Hi,

So how can I read the available records of my datasource. I saw in some
examples that print() method will print the available data of that
datasource. ( like files )

Thanks,
Pawan


On Wed, Mar 1, 2017 at 11:30 AM, Xingcan Cui <xingcanc@gmail.com> wrote:

> Hi Pawan,
>
> in Flink, most of the methods for DataSet (including print()) will just add
> operators to the plan but not really run it. If the DASInputFormat has no
> error, you can run the plan by calling environment.execute().
>
> Best,
> Xingcan
>
> On Wed, Mar 1, 2017 at 12:17 PM, Pawan Manishka Gunarathna <
> pawan.manishka@gmail.com> wrote:
>
> > Hi,
> >
> > I have implemented a Flink InputFormat interface related to my
> datasource.
> > It have our own data type as *Record*. So my class seems as follows,
> >
> > public class DASInputFormat implements InputFormat<Record,DASInputSplit>
> {
> > }
> >
> > So when I executed the print() method, my console shows the Flink
> > execution,
> > but nothing will print. So how can I read/print available records in
> > my datasource
> > table.
> >
> > ------------------------------------------------------------
> > -----------------------
> >
> > ExecutionEnvironment environment =
> > ExecutionEnvironment.getExecutionEnvironment();
> > DASInputFormat dasInputFormat = new DASInputFormat(1, "SAMPLETABLE1",2,
> > null,
> > Long.MIN_VALUE, Long.MAX_VALUE,0, -1);
> > DataSet<Record> dasRecords = environment.createInput(dasInputFormat);
> > dasRecords.print();
> >
> > Thanks,
> > Pawan
> > --
> >
> > *Pawan Gunaratne*
> > *Mob: +94 770373556*
> >
>



-- 

*Pawan Gunaratne*
*Mob: +94 770373556*

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message