[Fix](connector) encode doris http url path segments for non-ascll identifiers#657
Open
liujiwen-up wants to merge 1 commit into
Open
[Fix](connector) encode doris http url path segments for non-ascll identifiers#657liujiwen-up wants to merge 1 commit into
liujiwen-up wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
DorisUrlUtilshelper 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:
Checklist(Required)
Further comments
Validation:
mvn -Pflink1 -pl flink-doris-connector-base -Dtest=DorisUrlUtilsTest,TestRestService,TestDorisStreamLoad,TestDorisBatchStreamLoad,TestDorisCommitter,SchemaChangeManagerTest test