Skip to content

Fix/use pure connector 8kb truncation - #13

Open
ducanhtran1796 wants to merge 15 commits into
selectdb:mainfrom
ducanhtran1796:fix/use-pure-connector-8kb-truncation
Open

ducanhtran1796 wants to merge 15 commits into
selectdb:mainfrom
ducanhtran1796:fix/use-pure-connector-8kb-truncation

Conversation

@ducanhtran1796

Copy link
Copy Markdown

No description provided.

anhtd1 and others added 15 commits June 12, 2025 10:31
refactor handle_schema_evolution
refactor handle_schema_evolution
mysql-connector ships a C extension that is used by default whenever it is
installed (`use_pure` defaults to False in mysql.connector.connect). That
extension pushes statements through a fixed NET_BUFFER_LENGTH (8192) buffer,
and Doris' FE does not reassemble the resulting split packets: anything longer
than 8KB reaches the parser truncated mid-token.

The failure is confusing because it surfaces as a syntax error pointing at
whichever line happens to contain byte 8192, with a garbled token stream:

    no viable alternative at input 'CAST(JSONJSON(JSON'(line 155, pos 20)

A model that flattens ~100 JSON columns crosses 8KB easily, so this is hit by
any reasonably wide model rather than being an edge case.

Add `use_pure` to DorisCredentials, defaulting to True, and pass it through to
mysql.connector.connect(). Set `use_pure: false` in profiles.yml to opt back
into the C extension if every statement stays under 8KB.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

@ducanhtran1796 ducanhtran1796 left a comment

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

ok

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.

1 participant