Skip to content

Conversation

@jia17
Copy link
Contributor

@jia17 jia17 commented Apr 12, 2025

Purpose of this pull request

Fix #9104

Does this PR introduce any user-facing change?

no

How was this patch tested?

test in local

Check list

@Hisoka-X
Copy link
Member

Could you add a unit test for this?

@github-actions github-actions bot added tdengine and removed CI&CD core SeaTunnel core module Zeta e2e api labels Apr 14, 2025
@jia17 jia17 force-pushed the bugFix_TDengine_NULLPointer branch from 27fe470 to 2cd1707 Compare April 14, 2025 15:01
@jia17
Copy link
Contributor Author

jia17 commented Apr 14, 2025

@Hisoka-X I have added a unit test for the function I changed. Could you please review this PR?

}

@Test
void testConvertDataType_withNull() throws NoSuchMethodException, InvocationTargetException, IllegalAccessException {
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
void testConvertDataType_withNull() throws NoSuchMethodException, InvocationTargetException, IllegalAccessException {
void testConvertDataTypeWithNull() throws NoSuchMethodException, InvocationTargetException, IllegalAccessException {

Comment on lines 100 to 101
Method method = TDengineSinkWriter.class.getDeclaredMethod("convertDataType", Object[].class);
method.setAccessible(true);
Copy link
Member

Choose a reason for hiding this comment

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

It's better to not use reflect. Let's change convertDataType scope to default. Then add a annotation @VisibleForTesting.

@Hisoka-X
Copy link
Member

Also please follow the guide to open github action on your fork repository. Thanks! https://github.com/apache/seatunnel/pull/9158/checks?check_run_id=40516607099

@jia17
Copy link
Contributor Author

jia17 commented Apr 15, 2025

I have re-optimized the relevant functions based on your suggestions. Thank you!

@Hisoka-X
Copy link
Member

Please fix test case.
image

@jia17 jia17 force-pushed the bugFix_TDengine_NULLPointer branch from 58fd50f to 99e18b2 Compare April 15, 2025 09:21
@jia17 jia17 force-pushed the bugFix_TDengine_NULLPointer branch from e2f3ca9 to 99e18b2 Compare April 15, 2025 09:38
@github-actions github-actions bot removed the document label Apr 15, 2025
@jia17 jia17 force-pushed the bugFix_TDengine_NULLPointer branch from 99e18b2 to 34f3890 Compare April 15, 2025 09:48
@jia17
Copy link
Contributor Author

jia17 commented Apr 15, 2025

I have fix the test case.

@Hisoka-X
Copy link
Member

Thanks @jia17

@hailin0 hailin0 merged commit a047cab into apache:dev Apr 16, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] [TDengineSinkWriter] get java.lang.NullPointerException if there are empty value in some column or tag in tdengine source tables

3 participants