Skip to content

fix(reflection): parse OceanBase FTS_INDEX_TYPE in SHOW CREATE TABLE#68

Merged
whhe merged 3 commits into
oceanbase:mainfrom
whhe:fix/reflection-fts-index-type
Jun 5, 2026
Merged

fix(reflection): parse OceanBase FTS_INDEX_TYPE in SHOW CREATE TABLE#68
whhe merged 3 commits into
oceanbase:mainfrom
whhe:fix/reflection-fts-index-type

Conversation

@whhe

@whhe whhe commented Jun 5, 2026

Copy link
Copy Markdown
Member

Summary

  • Extend OceanBaseTableDefinitionParser._re_key to recognize PARSER_PROPERTIES with optional spaces around = (same pattern as BLOCK_SIZE).
  • Parse FTS_INDEX_TYPE (MATCH / PHRASE_MATCH) so metadata.reflect() no longer emits SAWarning: Unknown schema content for OceanBase fulltext indexes using the analyzer parser.

Context

When tables include DDL such as:

FULLTEXT KEY `fts_idx` (`col`) WITH PARSER analyzer
  PARSER_PROPERTIES = (analysis = '{"analyzer": "standard"}')
  FTS_INDEX_TYPE = PHRASE_MATCH
  BLOCK_SIZE 16384

reflection previously failed to match the index line and logged a warning. Functionality was unaffected; this only improves schema reflection compatibility.

Test plan

  • python3 -m unittest tests.test_reflection -v
  • Manual parse of user-reported DDL line: no Unknown schema content warnings

Made with Cursor

fix:
- Allow optional spaces around `=` for PARSER_PROPERTIES (align with BLOCK_SIZE style)
- Parse FTS_INDEX_TYPE clause to avoid SAWarning on unknown schema content during reflect

Co-authored-by: Cursor <cursoragent@cursor.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Improves OceanBase DDL reflection by expanding the table-definition key regex to recognize additional FULLTEXT index options, preventing reflection-time “Unknown schema content” warnings for analyzer-based fulltext indexes.

Changes:

  • Loosened PARSER_PROPERTIES matching to allow optional spaces around =.
  • Added parsing support for FTS_INDEX_TYPE (e.g., MATCH, PHRASE_MATCH) in key definitions.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread pyobvector/schema/reflection.py
…PERTIES

test:
- Add regression for FULLTEXT KEY with PARSER_PROPERTIES = (...) and FTS_INDEX_TYPE = PHRASE_MATCH

Co-authored-by: Cursor <cursoragent@cursor.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

Comment thread tests/test_reflection.py Outdated
test:
- Build FULLTEXT KEY line via concatenation to stay within pylint line limits
- Use readable parser_properties JSON instead of nested escapes in SQL literal

Co-authored-by: Cursor <cursoragent@cursor.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.

@whhe whhe merged commit 47308c3 into oceanbase:main Jun 5, 2026
8 checks passed
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