kaori-seasons opened a new pull request, #60982:
URL: https://github.com/apache/doris/pull/60982

   Implement Snowflake SQL dialect compatibility to improve direct execution 
coverage on Apache Doris from ~40% to ~85%.
   
   Phase 1 - Pure Alias Registration (16 aliases):
   - IFF -> If, ARRAY_CONSTRUCT -> Array, ARRAY_CAT -> ArrayConcat
   - ARRAY_TO_STRING -> ArrayJoin, PARSE_JSON -> JsonbParse
   - TRY_PARSE_JSON -> JsonbParseErrorToNull, CHECK_JSON -> JsonbValid
   - BASE64_ENCODE -> ToBase64, BASE64_DECODE_STRING -> FromBase64
   - HEX_ENCODE -> Hex, HEX_DECODE_STRING -> Unhex
   - ENDSWITH -> EndsWith, STARTSWITH -> StartsWith
   - GETDATE -> Now, LEN -> CharacterLength, CHARINDEX -> Locate
   - Fix: Merge duplicate JsonbValid registrations into single line
   
   Phase 2 - FE Expression Rewrite Functions (7 new classes):
   - ZEROIFNULL(x) -> Coalesce(x, Cast(0, x.type))
   - NULLIFZERO(x) -> NullIf(x, Cast(0, x.type))
   - NVL2(e1, e2, e3) -> If(Not(IsNull(e1)), e2, e3)
   - EQUAL_NULL(a, b) -> NullSafeEqual(a, b)
   - CONVERT_TIMEZONE(src, dst, ts) -> ConvertTz(ts, src, dst)
   - OBJECT_CONSTRUCT(k1, v1, ...) -> JsonObject(k1, v1, ...)
   - TO_VARCHAR(expr[, fmt]) -> Cast(expr, VARCHAR) or DateFormat(expr, fmt)
   
   All 7 functions registered in BuiltinScalarFunctions and 
ScalarFunctionVisitor.
   
   Tests:
   - 32 FE unit tests (SnowflakeCompatFunctionTest) covering all aliases and 
rewrite functions with constant and column-based scenarios
   - 2 regression test suites (test_snowflake_aliases.groovy, 
test_snowflake_rewrite.groovy) for end-to-end validation
   
   ### What problem does this PR solve?
   
   Issue Number: close #xxx
   
   Related PR: #xxx
   
   Problem Summary:
   
   ### Release note
   
   None
   
   ### Check List (For Author)
   
   - Test <!-- At least one of them must be included. -->
       - [ ] Regression test
       - [ ] Unit Test
       - [ ] Manual test (add detailed scripts or steps below)
       - [ ] No need to test or manual test. Explain why:
           - [ ] This is a refactor/code format and no logic has been changed.
           - [ ] Previous test can cover this change.
           - [ ] No code files have been changed.
           - [ ] Other reason <!-- Add your reason?  -->
   
   - Behavior changed:
       - [ ] No.
       - [ ] Yes. <!-- Explain the behavior change -->
   
   - Does this need documentation?
       - [ ] No.
       - [ ] Yes. <!-- Add document PR link here. eg: 
https://github.com/apache/doris-website/pull/1214 -->
   
   ### Check List (For Reviewer who merge this PR)
   
   - [ ] Confirm the release note
   - [ ] Confirm test cases
   - [ ] Confirm document
   - [ ] Add branch pick label <!-- Add branch pick label that this PR should 
merge into -->
   
   


-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to