Optimizing FlinkSQL JSON_VALUE Performance
This section applies to MRS 3.5.0 or later.
Scenarios
When the built-in JSON_VALUE function parses multiple fields of a JSON item, the parsing result of the previous JSON item is reused to improve the performance.
How to Use
When you configure a Flink job, set table.optimizing.json-value-optimization to true on the Flink job development page of the FlinkServer web UI to optimize the performance of the JSON_VALUE function. For details, see Creating a FlinkServer Job.
create table kafkaSource ( msgValue STRING ) with ( 'connector' = 'kafka' ,'topic' = 'topic-1' ,'properties.bootstrap.servers' ='Service IP address of the Kafka Broker instance:Kafka port' ,'properties.group.id' = 'group-1' ,'value.format' = 'raw' ,'scan.startup.mode' = 'group-offsets' ,'properties.auto.offset.reset' = 'earliest' ,'value.fields-include' = 'EXCEPT_KEY' ); create table print ( id STRING, name STRING ) with ( 'connector' = 'print' ); INSERT INTO print SELECT JSON_VAL(msgValue, '$.id'), JSON_VAL(msgValue, '$.name') from kafkaSource;
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot