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

2017-01-13 Thread Hongyuhong
Hi Fabian,

Yes, OrderA is a table of POJO.
But what I consume is that in construct func PojoTypeInfo
The input param (fields)’s order is right, it ‘s change after the sort 
operation, and I’m wonder if the sort operation can be removed?

public PojoTypeInfo(Class typeClass, List fields) {
super(typeClass);
 checkArgument(Modifier.isPublic(typeClass.getModifiers()),"POJO %s is not 
public", typeClass);
 this.fields = fields.toArray(new PojoField[fields.size()]);
 Arrays.sort(this.fields, new Comparator() {
 @Override
 public int compare(PojoField o1, PojoField o2) {
  return o1.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 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 difficult to automatically define an order, esp. if some fields 
use getter and setter or public fields. Would the order depend on the field 
(which might not exist in case of getter/setter) or setter or getter methods 
(which might also not exist).
I'm also not sure if it is possible to extract the line number of a method or 
field via reflection.
Best, Fabian


2017-01-13 9:54 GMT+01:00 Hongyuhong 
mailto:hongyuh...@huawei.com>>:
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,
What is the purpose of doing so?cause it’s a little not meet our requirements.

Thanks very much.


public PojoTypeInfo(Class typeClass, List fields) {
   super(typeClass);

   checkArgument(Modifier.isPublic(typeClass.getModifiers()),
 "POJO %s is not public", typeClass);

   this.fields = fields.toArray(new PojoField[fields.size()]);

   Arrays.sort(this.fields, new Comparator() {
@Override
public int compare(PojoField o1, PojoField o2) {
 return 
o1.getField().getName().compareTo(o2.getField().getName());
}
   });


Best,
Yuhong



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,
What is the purpose of doing so?cause it's a little not meet our requirements.

Thanks very much.


public PojoTypeInfo(Class typeClass, List fields) {
   super(typeClass);

   checkArgument(Modifier.isPublic(typeClass.getModifiers()),
 "POJO %s is not public", typeClass);

   this.fields = fields.toArray(new PojoField[fields.size()]);

   Arrays.sort(this.fields, new Comparator() {
@Override
public int compare(PojoField o1, PojoField o2) {
 return 
o1.getField().getName().compareTo(o2.getField().getName());
}
   });


Best,
Yuhong


Re: Som question about Flink stream sql

2017-01-05 Thread Hongyuhong
Thanks Jark

Do you have any design documents or instructions about row window? We are 
interested in adding supports of window in streamsql side and it’s greate if 
can have some reference.
Thanks very much.

Best
Yuhong


发件人: Jark Wu [mailto:wuchong...@alibaba-inc.com]
发送时间: 2017年1月6日 11:01
收件人: user@flink.apache.org
主题: Re: Som question about Flink stream sql

Hi Yuhong,

I have assigned an issue for tumble row-window, but the progress is still under 
design and discuss. The implementation of row window is more complex than group 
window.
I will push forward this issue in the next days.

- Jark Wu

在 2017年1月5日,下午7:00,Hongyuhong 
mailto:hongyuh...@huawei.com>> 写道:

Hi Fabian,

Thanks for the reply.
As you noticed, row windows are already supported by Calcite and FLIP-11 has 
planned,
Can you tell something about the progress of the row windows in Table API?

Regards.
Yuhong




发件人: Fabian Hueske [mailto:fhue...@gmail.com]
发送时间: 2017年1月5日 17:43
收件人: user@flink.apache.org<mailto:user@flink.apache.org>
主题: Re: Som question about Flink stream sql

Hi Yuhong,
as you noticed, FLIP-11 is about the window operations on the Table API and 
does not include SQL.
The reason is that the Table API is completely Flink domain, i.e., we can 
design and implement the API. For SQL we have a dependency on Calcite.
You are right, that Calcite's JIRA issue for group windows [1] seems to be 
stale. I don't have more information on that. You could ping there and ask what 
the status is.
Row windows are already supported by Calcite (SQL's OVER and WINDOW clauses), 
so these could be implemented for SQL as well.
Maybe it's even easier to start from the SQL side and add the Table API later 
to ensure a compatible compilation process.
Best, Fabian


2017-01-05 4:40 GMT+01:00 Hongyuhong 
mailto:hongyuh...@huawei.com>>:
Hi,
We are currently exploring on Flink streamsql ,
And I see the group-window has been implemented in Table API, and row-window is 
also planning in FLIP-11. It seems that row-window grammar is more similar to 
calcite over clause.
I’m curious about the detail plan and roadmap of stream sql, cause FLIP-11 just 
mentioned Table API.
And is that streamsql priority implement row-window? Or if group-window is 
considered, what is the status on calcite integration?
The issue on calcite jira was raised in August, what’s the status right now?
Thanks in advance!

Regards
Yuhong



答复: Som question about Flink stream sql

2017-01-05 Thread Hongyuhong
Hi Fabian,

Thanks for the reply.
As you noticed, row windows are already supported by Calcite and FLIP-11 has 
planned,
Can you tell something about the progress of the row windows in Table API?

Regards.
Yuhong




发件人: Fabian Hueske [mailto:fhue...@gmail.com]
发送时间: 2017年1月5日 17:43
收件人: user@flink.apache.org
主题: Re: Som question about Flink stream sql

Hi Yuhong,
as you noticed, FLIP-11 is about the window operations on the Table API and 
does not include SQL.
The reason is that the Table API is completely Flink domain, i.e., we can 
design and implement the API. For SQL we have a dependency on Calcite.
You are right, that Calcite's JIRA issue for group windows [1] seems to be 
stale. I don't have more information on that. You could ping there and ask what 
the status is.
Row windows are already supported by Calcite (SQL's OVER and WINDOW clauses), 
so these could be implemented for SQL as well.
Maybe it's even easier to start from the SQL side and add the Table API later 
to ensure a compatible compilation process.
Best, Fabian


2017-01-05 4:40 GMT+01:00 Hongyuhong 
mailto:hongyuh...@huawei.com>>:
Hi,
We are currently exploring on Flink streamsql ,
And I see the group-window has been implemented in Table API, and row-window is 
also planning in FLIP-11. It seems that row-window grammar is more similar to 
calcite over clause.
I’m curious about the detail plan and roadmap of stream sql, cause FLIP-11 just 
mentioned Table API.
And is that streamsql priority implement row-window? Or if group-window is 
considered, what is the status on calcite integration?
The issue on calcite jira was raised in August, what’s the status right now?
Thanks in advance!

Regards
Yuhong






Som question about Flink stream sql

2017-01-04 Thread Hongyuhong
Hi,
We are currently exploring on Flink streamsql ,
And I see the group-window has been implemented in Table API, and row-window is 
also planning in FLIP-11. It seems that row-window grammar is more similar to 
calcite over clause.
I'm curious about the detail plan and roadmap of stream sql, cause FLIP-11 just 
mentioned Table API.
And is that streamsql priority implement row-window? Or if group-window is 
considered, what is the status on calcite integration?
The issue on calcite jira was raised in August, what's the status right now?
Thanks in advance!

Regards
Yuhong