Optimizing the Performance of the SPLIT_INDEX Function in Flink SQL
Scenarios
The built-in SPLIT_INDEX function can reuse the parsing result of the last split when parsing multiple fields of a character string, thereby improving the computing performance.
Notes and Constraints
This section applies only to MRS 3.6.0-LTS and later.
How to Use
To optimize the performance of the SPLIT_INDEX function, you can add the custom parameter table.optimizing.split-index-optimization and set it to true when configuring a Flink job on the FlinkServer web UI. For details, see Creating a FlinkServer Job.
CREATE TABLE datagen (
auction BIGINT,
bidder BIGINT,
price BIGINT,
channel VARCHAR,
url VARCHAR
)
WITH
('connector' = 'datagen');
CREATE TABLE blackhole (
auction BIGINT,
bidder BIGINT,
price BIGINT,
channel VARCHAR,
dir1 VARCHAR,
dir2 VARCHAR,
dir3 VARCHAR
)
WITH
('connector' = 'blackhole');
INSERT INTO
blackhole
SELECT
auction,
bidder,
price,
channel,
SPLIT_INDEX (url, '/', 3) as dir1,
SPLIT_INDEX (url, '/', 4) as dir2,
SPLIT_INDEX (url, '/', 5) as dir3
FROM
datagen; What is your overall rating for this page?
Thank 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