Skip to content

Conversation

@alpass163
Copy link
Contributor

  1. Supported DoubleLiteral and LongLiteral comparisons for INT32 and INT64 columns. Implemented precise rounding logic (ceil/floor) for doubles and handled overflow scenarios
  2. introduce tsfile version: 2.2.0-251216-SNAPSHOT, update interfaces provided by tsfile

Copy link
Contributor

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

This pull request fixes a bug in the query filter predicate conversion logic that caused incompatible behavior when comparing INT32 or INT64 columns with double literals. The fix implements proper rounding logic (ceil/floor) for double values and handles overflow scenarios where doubles exceed integer type bounds. Additionally, the PR updates the TSFile dependency to version 2.2.0-251216-SNAPSHOT to accommodate new API interfaces.

Key changes include:

  • Implementation of double-to-integer conversion logic with appropriate rounding semantics for comparison operators
  • Overflow detection for doubles exceeding INT32/INT64 ranges, returning appropriate filters (FalseLiteralFilter or ValueIsNotNullOperator)
  • Support for INT64 literal comparisons with INT32 columns through type promotion
  • TSFile API updates to accommodate new method signatures requiring additional parameters or throwing IOException

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
pom.xml Updates TSFile version from 2.2.0-251113-SNAPSHOT to 2.2.0-251216-SNAPSHOT
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/analyzer/predicate/ConvertPredicateToFilterVisitor.java Implements double literal conversion logic for table model predicates with overflow handling
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/expression/visitor/predicate/ConvertPredicateToFilterVisitor.java Implements double literal conversion logic for tree model predicates with overflow handling using BigDecimal
iotdb-client/session/src/main/java/org/apache/iotdb/session/Session.java Removes unnecessary TSEncoding.valueOf wrapper due to TSFile API change
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/compaction/repair/RepairDataFileScanUtil.java Adds null parameter to getDeviceTimeseriesMetadata call for TSFile API compatibility
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/compaction/execute/utils/MultiTsFileDeviceIterator.java Adds IOException declarations and null parameter for TSFile API compatibility
iotdb-core/datanode/src/test/java/org/apache/iotdb/db/queryengine/plan/relational/predicate/TablePredicateConversionTest.java Comprehensive unit tests for table model double literal conversion covering positive/negative values, overflow, and all comparison operators
iotdb-core/datanode/src/test/java/org/apache/iotdb/db/queryengine/expression/predicate/TreePredicateConversionTest.java Comprehensive unit tests for tree model double literal conversion with parallel coverage to table model
integration-test/src/test/java/org/apache/iotdb/relational/it/query/recent/IoTDBPredicateConversionTableIT.java End-to-end integration tests validating query behavior with double literals for table model
integration-test/src/test/java/org/apache/iotdb/db/it/query/IoTDBPredicateConversionTreeIT.java End-to-end integration tests validating query behavior with double literals for tree model

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

Comment on lines 168 to 169
// when literal is the doubleLiteral type, the columnDataType INT64 or INT32 has to be
// converted.
Copy link

Copilot AI Dec 17, 2025

Choose a reason for hiding this comment

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

Comment is slightly misleading. It states that "columnDataType INT64 or INT32 has to be converted" when actually it's the double literal that gets converted (rounded) to match the integer column type. Consider rephrasing to: "when literal is DoubleLiteral and column is INT64 or INT32, convert the double literal to an appropriate integer value".

Copilot uses AI. Check for mistakes.
…or int32 column with double literals in query filter conditions.

introduce tsfile version: 2.2.0-251216-SNAPSHOT, update interfaces provided by tsfile
@alpass163 alpass163 force-pushed the cyb/fix_double_to_long branch from 7f6fa63 to 3d4bc23 Compare December 17, 2025 08:22
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