Skip to content

fix(hive): preserve column precision when scale is null#2191

Open
Aias00 wants to merge 1 commit into
OtterMind:mainfrom
Aias00:fix/hive-decimal-deadbranch
Open

fix(hive): preserve column precision when scale is null#2191
Aias00 wants to merge 1 commit into
OtterMind:mainfrom
Aias00:fix/hive-decimal-deadbranch

Conversation

@Aias00

@Aias00 Aias00 commented Jul 26, 2026

Copy link
Copy Markdown
Contributor

Related issue

Closes #2189

Summary

Same dead-branch bug as Sqlite #2167 and MySQL #2180. HiveColumnTypeEnum.buildDataType guarded with if (columnSize == null || decimalDigits == null), returning bare type for DECIMAL(10) (precision set, scale null). Changed to columnSize == null only, making the size-only branch reachable.

Verification

  • mvn compile -> BUILD SUCCESS.

Contributor declaration

  • I linked the Issue that defines this change.
  • I tested the affected behavior and reported the actual results above.
  • I did not include credentials, private data, or generated build output.
  • I disclosed substantial AI assistance below, or this PR contains no substantial AI-generated code.

AI assistance: The fix, verification, and PR description were produced with Claude Code assistance.

buildDataType guarded with columnSize == null || decimalDigits == null,
returning bare type for DECIMAL(10) (precision set, scale null). The
size-only branch was unreachable dead code. Guard on columnSize only,
mirroring every sibling. Same fix as Sqlite OtterMind#2167 and MySQL OtterMind#2180.

Fixes OtterMind#2189

Co-Authored-By: Claude <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings July 26, 2026 15:26
@Aias00
Aias00 requested a review from openai0229 as a code owner July 26, 2026 15:26

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@Aias00

Aias00 commented Jul 27, 2026

Copy link
Copy Markdown
Contributor Author

Live-database verification (same bug class)

Verified the same || decimalDigits == null dead-branch pattern against PostgreSQL 16 and MySQL 8:

  • PostgreSQL: DECIMAL(10)numeric(10,0)
  • MySQL: DECIMAL(15)decimal(15,0)

Hive has the identical code pattern; the fix (guard on columnSize == null only) makes the size-only branch reachable, preserving precision in the generated DDL.

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

Labels

None yet

Projects

Status: In Review

Development

Successfully merging this pull request may close these issues.

Hive buildDataType drops precision when scale is null (dead branch, same as Sqlite/MySQL)

3 participants