seatunnel icon indicating copy to clipboard operation
seatunnel copied to clipboard

[Feature][transform-v2]  Refine SQL/Zeta function UTs and stabilize transform behavior

Open yzeng1618 opened this issue 4 weeks ago • 0 comments

https://github.com/apache/seatunnel/issues/10137

Purpose of this pull request

This pull request fixes several edge‑case bugs in the SQL transform functions (mainly numeric, string and date/time functions) and adds/updates SQL‑level tests such as SQLNumericFunctionsTest, SQLStringFunctionsTest and SQLSystemFunctionsTest to cover them. It also cleans up test comments to remove Chinese characters so that ChineseCharacterCheckTest and the CI checks can pass.

Does this PR introduce any user-facing change?

Yes.

Some date/time functions (for example month difference and week/day‑of‑week related functions) are corrected to follow the documented and common SQL semantics. Numeric casting and SIGN behavior are adjusted (e.g. support for SHORT type, case‑insensitive type names, and SIGN(NULL) now returning NULL instead of 0). String functions such as ASCII, LEFT and RIGHT now handle NULL, empty strings and negative/zero lengths more consistently (e.g. ASCII(NULL)/ASCII('') return NULL, LEFT/RIGHT with negative length return an empty string and over‑length counts return the whole string). These are all bug fixes to existing SQL behavior; no new configuration or connector‑level behavior is introduced.

How was this patch tested?

Added and updated SQL‑level unit tests for numeric, string and system functions, including SQLNumericFunctionsTest, SQLStringFunctionsTest and SQLSystemFunctionsTest. Verified the behavior locally by running module tests such as mvn -pl seatunnel-transforms-v2 -Dtest=SQL*FunctionsTest test and ensuring ChineseCharacterCheckTest passes after removing Chinese comments.

Check list

  • [ ] If any new Jar binary package adding in your PR, please add License Notice according New License Guide
  • [ ] If necessary, please update the documentation to describe the new feature. https://github.com/apache/seatunnel/tree/dev/docs
  • [ ] If necessary, please update incompatible-changes.md to describe the incompatibility caused by this PR.
  • [ ] If you are contributing the connector code, please check that the following files are updated:
    1. Update plugin-mapping.properties and add new connector information in it
    2. Update the pom file of seatunnel-dist
    3. Add ci label in label-scope-conf
    4. Add e2e testcase in seatunnel-e2e
    5. Update connector plugin_config

yzeng1618 avatar Dec 03 '25 03:12 yzeng1618