Help Center/ MapReduce Service/ Component Operation Guide (LTS)/ Using Flink/ Enterprise-Class Enhancements of Flink/ Optimizing the Performance of the SPLIT_INDEX Function in Flink SQL
Updated on 2026-06-27 GMT+08:00

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.

Example SQL statement:
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;