Skip to content

feat: add support for custom tag order#363

Merged
alespour merged 14 commits intomainfrom
feat/write-column-order
Mar 3, 2026
Merged

feat: add support for custom tag order#363
alespour merged 14 commits intomainfrom
feat/write-column-order

Conversation

@alespour
Copy link
Contributor

@alespour alespour commented Mar 2, 2026

Proposed Changes

Adds support for specifying column (tag) order during ingestion via new tagOrder write option. This is primarily intended for the initial write, where sorting tags by query priority can significantly impact query performance:
https://docs.influxdata.com/influxdb3/enterprise/write-data/best-practices/schema-design/#sort-tags-by-query-priority

Also includes minor write performance optimizations.

Checklist

  • CHANGELOG.md updated
  • Rebased/mergeable
  • A test has been added if appropriate
  • Tests pass
  • Commit messages are conventional

@codecov
Copy link

codecov bot commented Mar 2, 2026

Codecov Report

❌ Patch coverage is 94.93671% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 87.90%. Comparing base (2366504) to head (24df6b4).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
src/main/java/com/influxdb/v3/client/Point.java 94.59% 0 Missing and 2 partials ⚠️
...nfluxdb/v3/client/internal/InfluxDBClientImpl.java 88.23% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #363      +/-   ##
==========================================
+ Coverage   87.26%   87.90%   +0.63%     
==========================================
  Files          20       20              
  Lines        1343     1397      +54     
  Branches      229      241      +12     
==========================================
+ Hits         1172     1228      +56     
  Misses         81       81              
+ Partials       90       88       -2     

☔ View full report in Codecov by Sentry.
📢 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.

@alespour alespour marked this pull request as ready for review March 2, 2026 10:28
@alespour alespour requested a review from Copilot March 2, 2026 10:28
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds a tagOrder write option to control tag (column) ordering during ingestion, enabling users to optimize InfluxDB query performance by ordering tags by query priority.

Changes:

  • Introduces tagOrder in WriteOptions (builder, storage, equality/hash, safe accessor).
  • Updates point serialization to accept default tags + preferred tag ordering.
  • Expands tests and documentation to cover ordered-tag writes and serialization behavior.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/main/java/com/influxdb/v3/client/write/WriteOptions.java Adds tagOrder option plumbing (field, ctor/builder, equals/hashCode, accessor).
src/main/java/com/influxdb/v3/client/internal/InfluxDBClientImpl.java Uses the new ordered serialization path when writing Point instances.
src/main/java/com/influxdb/v3/client/Point.java Adds toLineProtocol overload and tag-merge/reorder logic for serialization.
src/test/java/com/influxdb/v3/client/write/WriteOptionsTest.java Adds tests for tagOrder, and extends equals/hashCode coverage.
src/test/java/com/influxdb/v3/client/PointTest.java Adds coverage for line protocol serialization with default tags + tag order.
src/test/java/com/influxdb/v3/client/InfluxDBClientWriteTest.java Adds an integration-style test verifying ordered tags are sent on write.
README.md Documents how to use tagOrder via WriteOptions.
CHANGELOG.md Notes the new tagOrder feature and links to InfluxDB guidance.

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

alespour and others added 2 commits March 2, 2026 11:38
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copy link

Copilot AI left a comment

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 8 out of 8 changed files in this pull request and generated 1 comment.


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

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copy link

Copilot AI left a comment

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 8 out of 8 changed files in this pull request and generated 3 comments.


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

Copy link

Copilot AI left a comment

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 9 out of 9 changed files in this pull request and generated 1 comment.


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

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copy link

Copilot AI left a comment

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 9 out of 9 changed files in this pull request and generated no new comments.


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

Copy link
Member

@bednar bednar left a comment

Choose a reason for hiding this comment

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

LGTM 🚀

@alespour alespour merged commit 0283c9f into main Mar 3, 2026
15 checks passed
@alespour alespour deleted the feat/write-column-order branch March 3, 2026 07:34
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