Re: To get Schema for jdbc database in Flink

2017-02-08 Thread Punit Tandel
Ok . I am right now simply taking a POJO to get the data types and schema but needed generic approach to get these information. Thanks On 02/08/2017 01:37 PM, Flavio Pompermaier wrote: I also thought about it and my conclusion was to use a generic sql parser (e.g. Calcite?) to extract the col

Re: To get Schema for jdbc database in Flink

2017-02-08 Thread Flavio Pompermaier
I also thought about it and my conclusion was to use a generic sql parser (e.g. Calcite?) to extract the column names from the input query (because in the query you can rename/add fields...).. I'd like to hear opinions about this..unfortunately I don't have the time to implement this right now :(

Re: To get Schema for jdbc database in Flink

2017-02-08 Thread Punit Tandel
HI With this approach i will be able to get data types but not the column names because TypeInformation typeInformation = dataStream.getType() will return types but not the columns names. Is there any other way to get the column names from Row? Thanks Punit On 02/08/2017 10:17 AM, Chesnay

Re: To get Schema for jdbc database in Flink

2017-02-08 Thread Chesnay Schepler
Hello, in the JDBC case i would suggest that you extract the schema from the first Row that your sink receives, create the table, and then start writing data. However, keep in mind that Rows can contain null fields; so you may not be able to extract the entire schema if the first row has a n

Re: To get Schema for jdbc database in Flink

2017-02-08 Thread Punit Tandel
Hi Chesnay Currently that is what i have done, reading the schema from database in order to create a new table in jdbc database and writing the rows coming from jdbcinputformat. Overall i am trying to implement the solution which reads the streaming data from one source which either could be

Re: To get Schema for jdbc database in Flink

2017-02-08 Thread Chesnay Schepler
Hello, I don't understand why you explicitly need the schema since the batch JDBCInput-/Outputformats don't require it. That's kind of the nice thing about Rows. Would be cool if you could tell us what you're planning to do with the schema :) In any case, to get the schema within the plan t

Re: To get Schema for jdbc database in Flink

2017-02-07 Thread Punit Tandel
Hi Robert Thanks for the response, So in near future release of the flink version , is this functionality going to be implemented ? Thanks On 02/07/2017 04:12 PM, Robert Metzger wrote: Currently, there is no streaming JDBC connector. Check out this thread from last year: http://apache-flink

Re: To get Schema for jdbc database in Flink

2017-02-07 Thread Robert Metzger
Currently, there is no streaming JDBC connector. Check out this thread from last year: http://apache-flink-mailing-list-archive.1008284.n3.nabble.com/JDBC-Streaming-Connector-td10508.html On Mon, Feb 6, 2017 at 5:00 PM, Ufuk Celebi wrote: > I'm not sure how well this works for the streaming AP

Re: To get Schema for jdbc database in Flink

2017-02-06 Thread Ufuk Celebi
I'm not sure how well this works for the streaming API. Looping in Chesnay, who worked on this. On Mon, Feb 6, 2017 at 11:09 AM, Punit Tandel wrote: > Hi , > > I was looking into flink streaming api and trying to implement the solution > for reading the data from jdbc database and writing them to

Fwd: To get Schema for jdbc database in Flink

2017-02-06 Thread Punit Tandel
Hi , I was looking into flink streaming api and trying to implement the solution for reading the data from jdbc database and writing them to jdbc databse again. At the moment i can see the datastream is returning Row from the database. dataStream.getType().getGenericParameters() retuning an