Re: the attribute order in sql 'select * from...'

2017-01-13 Thread Timo Walther
.getField().getName().compareTo(o2.getField().getName());* * }* }); *发件人:*Fabian Hueske [mailto:fhue...@gmail.com <mailto:fhue...@gmail.com>] *发送时间:*2017年1月13日17:23 *收件人:*user@flink.apache.org <mailto:user@flink.apache.org> *主题:*Re: the attribute order in

Re: the attribute order in sql 'select * from...'

2017-01-13 Thread Fabian Hueske
> }); > > > > > > *发件人:* Fabian Hueske [mailto:fhue...@gmail.com] > *发送时间:* 2017年1月13日 17:23 > *收件人:* user@flink.apache.org > *主题:* Re: the attribute order in sql 'select * from...' > > > > Hi Yuhong, > > I assume that OrderA is a table of PO

Re: the attribute order in sql 'select * from...'

2017-01-13 Thread Timo Walther
Hi Yuhong, as a solution you can specify the order of your Pojo fields when converting from DataStream to Table. Table table = tableEnv .fromDataSet(env.fromCollection(data), "department AS a, " + "age AS b, " + "salary AS c, " + "name AS d") .select("a, b, c, d"); T

Re: the attribute order in sql 'select * from...'

2017-01-13 Thread Hongyuhong
1.getField().getName().compareTo(o2.getField().getName()); } }); 发件人: Fabian Hueske [mailto:fhue...@gmail.com] 发送时间: 2017年1月13日 17:23 收件人: user@flink.apache.org 主题: Re: the attribute order in sql 'select * from...' Hi Yuhong, I assume that OrderA is a table of POJO objects and you are exp

Re: the attribute order in sql 'select * from...'

2017-01-13 Thread Fabian Hueske
Hi Yuhong, I assume that OrderA is a table of POJO objects and you are expecting the order of the attribute to be as the order in which the fields of the POJO are defined in the source code. Flink accepts fields which are either public members or accessible via a getter and setter. This makes it

the attribute order in sql 'select * from...'

2017-01-13 Thread Hongyuhong
Hi, I'm now using streaming sql, And I have the sql like select * FROM OrderA where user > 2 the OrderA has 3 attr (user, product, amount) and I expect the result is as the order like input, but it has been sorted by attr name, and I found the order has already been sorted when call addSource, Wh