Skip to content

fix(datasource): filter Hive partition metadata from table fields - #1367

Merged
XiaJunjie2020 merged 2 commits into
dataease:mainfrom
KrisWuli006:codex/fix-hive-partition-fields
Sep 15, 2026
Merged

XiaJunjie2020 merged 2 commits into
dataease:mainfrom
KrisWuli006:codex/fix-hive-partition-fields

Conversation

@KrisWuli006

Copy link
Copy Markdown
Contributor

Fixes #1250.

Hive DESCRIBE returns blank rows and section headers such as # Partition Information and # col_name, and can repeat partition columns. These rows currently become table fields, causing data previews to reference metadata instead of real columns.

Filter blank names and metadata headers in the Hive field-discovery branch, and deduplicate fields while preserving the first occurrence and original order. Keep real partition columns, valid hash-prefixed column names, and compatibility with extra driver columns.

Validation (Python 3.11):

  • python -m pytest backend/tests -q: 11 passed, including 8 Hive regression cases.
  • ruff check backend/tests/test_hive_fields.py and git diff --check: passed.
  • Full suite (tests backend/tests): 117 passed, 3 skipped, 1 pre-existing failure in ExecutionErrorDetailsTestCase.test_ai_log_skips_normal_content_after_an_error. The same failure reproduces on unmodified base 8424dcbf (109 passed, 3 skipped, 1 failed). MiniMax API tests were skipped without credentials.

The Hive regression tests execute the production definitions with a mocked cursor, following the existing connection-pool test pattern. Live Hive integration has not been tested.

Ignore blank names and DESCRIBE metadata headers. Retain partition columns once in their original order, preserve valid hash-prefixed column names, and keep support for extra driver columns.

Refs dataease#1250.
Add eight regression cases for partition metadata, duplicate fields, blank names, valid hash-prefixed columns, empty results, and extra driver columns. Execute the production get_fields and ColumnSchema definitions with a mocked Hive cursor.

Validation: python -m pytest backend/tests -q (11 passed).
@XiaJunjie2020
XiaJunjie2020 merged commit 65110d6 into dataease:main Sep 15, 2026
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.

[BUG] Hive 分区表导入时将 # Partition Information 误识别为字段,导致数据预览失败

2 participants