help me

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

help me

hager sallah
I want write program flink on any databaseuser input filed and type of filed and when read database want generate  automatic function  dataset
any example in flink i know database and write function to handles thisexamplefinal ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment();
 // get input data DataSet<Lineitem> lineitems = getLineitemDataSet(env); DataSet<Order> orders = getOrdersDataSet(env); DataSet<Customer> customers = getCustomerDataSet(env);

 // ************************************************************************* //     DATA TYPES // *************************************************************************  public static class Lineitem extends Tuple4<Long, Double, Double, String> {
 public Long getOrderkey() { return this.f0; } public Double getDiscount() { return this.f2; } public Double getExtendedprice() { return this.f1; } public String getShipdate() { return this.f3; } }
 public static class Customer extends Tuple2<Long, String> {  public Long getCustKey() { return this.f0; } public String getMktsegment() { return this.f1; } }
 public static class Order extends Tuple4<Long, Long, String, Long> {  public Long getOrderKey() { return this.f0; } public Long getCustKey() { return this.f1; } public String getOrderdate() { return this.f2; } public Long getShippriority() { return this.f3; } }
I want generate this automatic for any database and input from user

Reply | Threaded
Open this post in threaded view
|

Re: help me

aalexandrov
Hello,

Can you please re-post this on the user list and make sure you have
formatted the example code.

At the moment it is kind of hard to read.

2015-04-09 15:35 GMT+02:00 hager sallah <[hidden email]>:

> I want write program flink on any databaseuser input filed and type of
> filed and when read database want generate  automatic function  dataset
> any example in flink i know database and write function to handles
> thisexamplefinal ExecutionEnvironment env =
> ExecutionEnvironment.getExecutionEnvironment();
>  // get input data DataSet<Lineitem> lineitems = getLineitemDataSet(env);
> DataSet<Order> orders = getOrdersDataSet(env); DataSet<Customer> customers
> = getCustomerDataSet(env);
>
>  //
> *************************************************************************
> //     DATA TYPES //
> *************************************************************************
> public static class Lineitem extends Tuple4<Long, Double, Double, String> {
>  public Long getOrderkey() { return this.f0; } public Double getDiscount()
> { return this.f2; } public Double getExtendedprice() { return this.f1; }
> public String getShipdate() { return this.f3; } }
>  public static class Customer extends Tuple2<Long, String> {  public Long
> getCustKey() { return this.f0; } public String getMktsegment() { return
> this.f1; } }
>  public static class Order extends Tuple4<Long, Long, String, Long> {
> public Long getOrderKey() { return this.f0; } public Long getCustKey() {
> return this.f1; } public String getOrderdate() { return this.f2; } public
> Long getShippriority() { return this.f3; } }
> I want generate this automatic for any database and input from user
>
>
Reply | Threaded
Open this post in threaded view
|

Re: help me

Stephan Ewen
Hi Hager!

Some better formatted code would be good, I agree.

It looks like you want automatic data types for what comes out of the
database, so you need not manually create a class for each input.

Can you take a look at the Table API ? It allows you to transform any data
set into a Table with attributes. Internally, it generates the data types
automatically.

Does that solve your problem?

Greetings,
Stephan


On Thu, Apr 9, 2015 at 7:19 PM, Alexander Alexandrov <
[hidden email]> wrote:

> Hello,
>
> Can you please re-post this on the user list and make sure you have
> formatted the example code.
>
> At the moment it is kind of hard to read.
>
> 2015-04-09 15:35 GMT+02:00 hager sallah <[hidden email]>:
>
> > I want write program flink on any databaseuser input filed and type of
> > filed and when read database want generate  automatic function  dataset
> > any example in flink i know database and write function to handles
> > thisexamplefinal ExecutionEnvironment env =
> > ExecutionEnvironment.getExecutionEnvironment();
> >  // get input data DataSet<Lineitem> lineitems = getLineitemDataSet(env);
> > DataSet<Order> orders = getOrdersDataSet(env); DataSet<Customer>
> customers
> > = getCustomerDataSet(env);
> >
> >  //
> > *************************************************************************
> > //     DATA TYPES //
> > *************************************************************************
> > public static class Lineitem extends Tuple4<Long, Double, Double,
> String> {
> >  public Long getOrderkey() { return this.f0; } public Double
> getDiscount()
> > { return this.f2; } public Double getExtendedprice() { return this.f1; }
> > public String getShipdate() { return this.f3; } }
> >  public static class Customer extends Tuple2<Long, String> {  public Long
> > getCustKey() { return this.f0; } public String getMktsegment() { return
> > this.f1; } }
> >  public static class Order extends Tuple4<Long, Long, String, Long> {
> > public Long getOrderKey() { return this.f0; } public Long getCustKey() {
> > return this.f1; } public String getOrderdate() { return this.f2; } public
> > Long getShippriority() { return this.f3; } }
> > I want generate this automatic for any database and input from user
> >
> >
>