Table result to String

32 views Asked by At

I am trying Dynamic rule with Table API, In my system I have SQL rule coming from Kafka. So I have used a broadcast mechanism to implement the same. But I am stuck on how can I give results back to the output.

@Override
    public void processElement(
            final String data,
            ReadOnlyContext ctx,
            Collector<String> out) throws Exception {
        DataStream<String> dataStream=streamExecutionEnvironment.fromElements(data);

        streamTableEnvironment.createTemporaryView(
                "keyur_table",
                dataStream);

        //Dynamic SQL will go over here
        Table resultTable = streamTableEnvironment.sqlQuery("SELECT * FROM keyur_table");

    }

Here output object is a string and I also want to give output back to Kafka. I have tried by Kafka connector but it didn't work.

0

There are 0 answers