the location of JsonRowDeserializationSchema.java

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

the location of JsonRowDeserializationSchema.java

Hung
Hi Flink users,

I found this very useful JsonRowDeserializationSchema is in Kafka connector.
https://github.com/apache/flink/blob/master/flink-connectors/flink-connector-kafka-base/src/main/java/org/apache/flink/streaming/util/serialization/JsonRowDeserializationSchema.java

Shouldn't JsonRowDeserializationSchema be more general?
For example in our case we want to serialize json object via the REST API
but not through Kafka.

Best,

Sendoh



--
Sent from: http://apache-flink-user-mailing-list-archive.2336050.n4.nabble.com/
Reply | Threaded
Open this post in threaded view
|

Re: the location of JsonRowDeserializationSchema.java

Fabian Hueske-2
The schema is used in Flink's KafkaJsonTableSources.
Looking at the interface, I don't think it is very specific to Kafka. It just converts byte[] to Row.

It would be certainly possible to move it into a separate module to make it reusable without adding a Kafka dependency.
I think this will happen at some point, when we add more TableSources to read JSON encoded data (e.g., for Kinesis).

Best, Fabian

2017-12-06 17:35 GMT+01:00 Sendoh <[hidden email]>:
Hi Flink users,

I found this very useful JsonRowDeserializationSchema is in Kafka connector.
https://github.com/apache/flink/blob/master/flink-connectors/flink-connector-kafka-base/src/main/java/org/apache/flink/streaming/util/serialization/JsonRowDeserializationSchema.java

Shouldn't JsonRowDeserializationSchema be more general?
For example in our case we want to serialize json object via the REST API
but not through Kafka.

Best,

Sendoh



--
Sent from: http://apache-flink-user-mailing-list-archive.2336050.n4.nabble.com/

Reply | Threaded
Open this post in threaded view
|

Re: the location of JsonRowDeserializationSchema.java

Hung
exactly! I initially thought this class is in table API. I was building a
custom table source and found I have to add Kafka connector dependency for
reading JSON encoded data, although my table source doesn't need it.

Cheers,

Hung



--
Sent from: http://apache-flink-user-mailing-list-archive.2336050.n4.nabble.com/
Reply | Threaded
Open this post in threaded view
|

Re: the location of JsonRowDeserializationSchema.java

Fabian Hueske-2
Would you like to create a JIRA to move the JSON parsing out of the Flink Kafka connector module into a dedicated module?

2017-12-07 10:18 GMT+01:00 Sendoh <[hidden email]>:
exactly! I initially thought this class is in table API. I was building a
custom table source and found I have to add Kafka connector dependency for
reading JSON encoded data, although my table source doesn't need it.

Cheers,

Hung