FearfulTomcat27 opened a new pull request, #13909: URL: https://github.com/apache/iotdb/pull/13909
This pull request introduces a new `TryCastFunctionColumnTransformer` to handle safe casting operations and refactors the existing cast functionality to use an abstract base class. The key changes include adding the new transformer, updating the cast visitor to utilize the safe cast when applicable, and refactoring the cast transformers to inherit from a common abstract class. ### New Feature Introduction: * [`iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/transformation/dag/column/unary/scalar/TryCastFunctionColumnTransformer.java`](diffhunk://#diff-3b0b89be6f0edd72821d73b79d483f69cff0bcd87b29b4d645fc733c0f9ad4e8R153): Added a new transformer for try cast operations. ### Refactoring: * [`iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/transformation/dag/column/unary/scalar/AbstractCastFunctionColumnTransformer.java`](diffhunk://#diff-636393e41f47a869fcf39890782f34edecdfedf1767c5d8944f302e471d7dd4eR1-R350): Introduced an abstract base class for cast function transformers to consolidate common logic. * [`iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/transformation/dag/column/unary/scalar/CastFunctionColumnTransformer.java`](diffhunk://#diff-31033d76c6bbf4bcc35b9a0116ca3183dd34420c328769448640b7cd1d2c6520L22-R39): Refactored to extend the new abstract base class, removing redundant code. ### Cast Visitor Update: * [`iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/execution/relational/ColumnTransformerBuilder.java`](diffhunk://#diff-3b0b89be6f0edd72821d73b79d483f69cff0bcd87b29b4d645fc733c0f9ad4e8L356-R360): Updated the cast visitor to use `TryCastFunctionColumnTransformer` for safe casts. * [`iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/sql/parser/AstBuilder.java`](diffhunk://#diff-c4c070e2e01f6ec7778f31ee74f05ab7f9808aa41095c0533d9016e51e2ac5c6R1698-R1703): Modified the cast node visitor to identify and handle safe casts. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
