Skip to content

[Fix](connector) encode doris http url path segments for non-ascll identifiers#657

Open
liujiwen-up wants to merge 1 commit into
apache:masterfrom
liujiwen-up:master
Open

[Fix](connector) encode doris http url path segments for non-ascll identifiers#657
liujiwen-up wants to merge 1 commit into
apache:masterfrom
liujiwen-up:master

Conversation

@liujiwen-up
Copy link
Copy Markdown
Contributor

Proposed changes

Issue Number: close #xxx

Problem Summary:

This PR fixes failures when Doris database/table identifiers contain non-ASCII characters, such as Chinese table names.

Previously, the connector built several Doris HTTP API URLs by directly concatenating database/table names into the path, for example:

  • /api/{db}/{table}/_schema
  • /api/{db}/{table}/_query_plan
  • /api/{db}/{table}/_stream_load
  • /api/{db}/_stream_load_2pc
  • /api/enable_light_schema_change/{db}/{table}
  • /api/query/default_cluster/{db}

When the table name contains Chinese characters, Flink SQL planning may fail while fetching schema or query plan from Doris FE.

This PR adds a shared DorisUrlUtils helper to encode each HTTP path segment with UTF-8 percent encoding, and updates the related REST, Stream Load, Batch Stream Load, 2PC commit, and schema change paths to use it.

The change only encodes HTTP URL path segments. It does not change table.identifier, SQL identifier quoting, Stream Load labels, headers, or COPY mode behavior.

Added unit tests for:

  • URL path segment encoding
  • schema and query plan URLs
  • Stream Load URLs
  • Batch Stream Load URLs
  • 2PC commit URLs
  • schema change URLs

Checklist(Required)

  1. Does it affect the original behavior: Yes
  2. Has unit tests been added: Yes
  3. Has document been added or modified: No Need
  4. Does it need to update dependencies: No
  5. Are there any changes that cannot be rolled back: No

Further comments

Validation:

mvn -Pflink1 -pl flink-doris-connector-base -Dtest=DorisUrlUtilsTest,TestRestService,TestDorisStreamLoad,TestDorisBatchStreamLoad,TestDorisCommitter,SchemaChangeManagerTest test

@liujiwen-up liujiwen-up changed the title [Fix](connector) encode Doris HTTP URL path segments for non-ASCII identifiers [Fix](connector) encode doris http url path segments for non-ascll identifiers May 16, 2026
@JNSimba JNSimba requested a review from Copilot May 18, 2026 09:37
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants