Re: [Table API] ClassCastException when converting a table to DataStream

2019-07-23 Thread Rong Rong
Hi Dongwon, Sorry for the late reply. I did try some experiment and seems like you are right: Setting the `.return()` type actually alter the underlying type of the DataStream from a GenericType into a specific RowTypeInfo. Please see the JIRA ticket [1] for more info. Regarding the approach,

Re: [Table API] ClassCastException when converting a table to DataStream

2019-07-23 Thread Dongwon Kim
Hi Fabian, Thanks for clarification :-) I could convert back and forth without worrying about it as I keep using Row type during the conversion (even though fields are added). Best, Dongwon On Tue, Jul 23, 2019 at 8:15 PM Fabian Hueske wrote: > Hi Dongwon, > > regarding the question about

Re: [Table API] ClassCastException when converting a table to DataStream

2019-07-23 Thread Fabian Hueske
Hi Dongwon, regarding the question about the conversion: If you keep using the Row type and not adding/removing fields, the conversion is pretty much for free right now. It will be a MapFunction (sometimes even not function at all) that should be chained with the other operators. Hence, it should

Re: [Table API] ClassCastException when converting a table to DataStream

2019-07-19 Thread Dongwon Kim
Hi Rong, I have to dig deeper into the code to reproduce this error. This seems to > be a bug to me and will update once I find anything. Thanks a lot for spending your time on this. However from what you explained, if I understand correctly you can do all > of your processing within the

Re: [Table API] ClassCastException when converting a table to DataStream

2019-07-19 Thread Rong Rong
Hi Dongwon, I have to dig deeper into the code to reproduce this error. This seems to be a bug to me and will update once I find anything. However from what you explained, if I understand correctly you can do all of your processing within the TableAPI scope without converting it back and forth

Re: [Table API] ClassCastException when converting a table to DataStream

2019-07-18 Thread Dongwon Kim
Hi Rong, Thank you for reply :-) which Flink version are you using? I'm using Flink-1.8.0. what is the "sourceTable.getSchema().toRowType()" return? Row(time1: TimeIndicatorTypeInfo(rowtime)) what is the line *".map(a -> a)" *do and can you remove it? *".map(a->a)"* is just to illustrate a

Re: [Table API] ClassCastException when converting a table to DataStream

2019-07-18 Thread Rong Rong
Hi Dongwon, Can you provide a bit more information: which Flink version are you using? what is the "sourceTable.getSchema().toRowType()" return? what is the line *".map(a -> a)" *do and can you remove it? if I am understanding correctly, you are also using "time1" as the rowtime, is that want

[Table API] ClassCastException when converting a table to DataStream

2019-07-17 Thread Dongwon Kim
Hello, Consider the following snippet: > Table sourceTable = getKafkaSource0(tEnv); > DataStream stream = tEnv.toAppendStream(sourceTable, Row.class) > > * .map(a -> a) .returns(sourceTable.getSchema().toRowType());* > stream.print(); > where sourceTable.printSchema()