Pipe: Fixed the NPE of OPC UA Sink in table model when there are null values & Deleted the extra folder of opc ua sink in table model#15215
Merged
SteveYurongSu merged 2 commits intoapache:masterfrom Mar 27, 2025
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR addresses an NPE in the OPC UA Sink when encountering null values and removes an unnecessary folder level in the table model.
- Adjusts the length of the folder segments array to eliminate an extra folder.
- Adds a null check in the tablet value conversion to prevent an NPE.
- Skips null measurement values during OPC UA node creation.
Comments suppressed due to low confidence (3)
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/connector/protocol/opcua/OpcUaNameSpace.java:152
- Please confirm if the change from segments.length + 2 to segments.length + 1 correctly reflects the intended folder hierarchy adjustment without impacting downstream processing.
final String[] folderSegments = new String[segments.length + 1];
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/connector/protocol/opcua/OpcUaNameSpace.java:167
- [nitpick] Confirm that returning null in place of a tablet value is acceptable for OPC UA processing to avoid potential side effects downstream.
tablet.isNull(finalI, index) ? null : getTabletObjectValue4Opc(
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/connector/protocol/opcua/OpcUaNameSpace.java:233
- [nitpick] Ensure that skipping null measurement values will not cause misalignment in the sequence of measurements expected later in the process.
if (Objects.isNull(values.get(i))) {
SteveYurongSu
approved these changes
Mar 27, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
As the title said.
This PR has:
for an unfamiliar reader.
for code coverage.
Key changed/added classes (or packages if there are too many classes) in this PR