Skip to content

Comments

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
Caideyipi:opc-ua-fix-npe
Mar 27, 2025
Merged

Conversation

@Caideyipi
Copy link
Collaborator

Description

As the title said.


This PR has:

  • been self-reviewed.
    • concurrent read
    • concurrent write
    • concurrent read and write
  • added documentation for new or modified features or behaviors.
  • added Javadocs for most classes and all non-trivial methods.
  • added or updated version, license, or notice information
  • added comments explaining the "why" and the intent of the code wherever would not be obvious
    for an unfamiliar reader.
  • added unit tests or modified existing tests to cover new code paths, ensuring the threshold
    for code coverage.
  • added integration tests.
  • been tested in a test IoTDB cluster.

Key changed/added classes (or packages if there are too many classes) in this PR

@Caideyipi Caideyipi changed the title Pipe: Fixed the NPE of OPC UA Sink when there are null values 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 Mar 27, 2025
@SteveYurongSu SteveYurongSu self-assigned this Mar 27, 2025
@SteveYurongSu SteveYurongSu requested a review from Copilot March 27, 2025 13:42
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 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 SteveYurongSu merged commit f66fcd9 into apache:master Mar 27, 2025
49 of 50 checks passed
JackieTien97 pushed a commit that referenced this pull request Apr 14, 2025
… values & Deleted the extra folder of opc ua sink in table model (#15215)

(cherry picked from commit f66fcd9)
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