Skip to content

Refactor data type handling with type interfaces - #872

Merged
jt2594838 merged 139 commits into
developfrom
add_interfaces_for_type
Sep 8, 2026
Merged

jt2594838 merged 139 commits into
developfrom
add_interfaces_for_type

Conversation

@jt2594838

Copy link
Copy Markdown
Contributor

Summary

  • introduce type interfaces and services for data-type-specific operations
  • replace direct TSDataType switch logic across read, write, tools, examples, and tests
  • move casting, sizing, numeric, and comparable behavior into type or enum-specific implementations
  • preserve unsupported-type handling and route new user-facing messages through i18n resources

Testing

  • ./mvnw test -P with-java -pl java/tsfile -am -Dtest=TypeCastTest -Dsurefire.failIfNoSpecifiedTests=false
  • Spotless and Checkstyle validation

@codecov-commenter

codecov-commenter commented Jul 21, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 76.55877% with 688 lines in your changes missing coverage. Please review.
✅ Project coverage is 64.10%. Comparing base (9be35b9) to head (f2f9c98).

Files with missing lines Patch % Lines
...ain/java/org/apache/tsfile/utils/TypeServices.java 40.16% 146 Missing ⚠️
.../main/java/org/apache/tsfile/enums/TSDataType.java 0.00% 141 Missing ⚠️
.../java/org/apache/tsfile/utils/TsPrimitiveType.java 0.00% 89 Missing ⚠️
.../java/org/apache/tsfile/read/common/type/Type.java 47.00% 53 Missing ⚠️
...rg/apache/tsfile/read/common/type/TypeFactory.java 45.16% 17 Missing ⚠️
...org/apache/tsfile/read/common/type/DoubleType.java 89.93% 15 Missing ⚠️
...org/apache/tsfile/read/common/type/ObjectType.java 88.97% 15 Missing ⚠️
.../org/apache/tsfile/read/common/type/FloatType.java 90.54% 14 Missing ⚠️
...a/org/apache/tsfile/read/common/type/BlobType.java 90.90% 13 Missing ⚠️
...rg/apache/tsfile/read/common/type/BooleanType.java 91.27% 13 Missing ⚠️
... and 35 more
Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #872      +/-   ##
===========================================
+ Coverage    61.83%   64.10%   +2.26%     
===========================================
  Files          747      757      +10     
  Lines        51929    52910     +981     
  Branches      8444     8333     -111     
===========================================
+ Hits         32109    33916    +1807     
+ Misses       18184    17358     -826     
  Partials      1636     1636              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

default:
throw new UnSupportedDataTypeException(String.valueOf(dataType));
}
Type.fromTsDataType(dataType).init(this);

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.

DescReadWriteBatchData initializes value lists as ArrayLists but casts them to LinkedList when expanding. This causes a ClassCastException on the 1,025th value.

@jt2594838
jt2594838 merged commit 02b503b into develop Sep 8, 2026
47 checks passed
@jt2594838
jt2594838 deleted the add_interfaces_for_type branch September 8, 2026 10:55
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.

3 participants