Skip to content

Fix error of non-mappable udtf query in align by device while existing any devices' data cross region#16248

Merged
JackieTien97 merged 2 commits intomasterfrom
FixUDTF
Aug 26, 2025
Merged

Fix error of non-mappable udtf query in align by device while existing any devices' data cross region#16248
JackieTien97 merged 2 commits intomasterfrom
FixUDTF

Conversation

@JackieTien97
Copy link
Contributor

This pull request updates the device view aggregation logic in the query engine to better handle User-Defined Table Functions (UDTFs) and clarifies when special processing is needed. The main changes involve extending the special-case handling to include UDTFs and refactoring related method names for clarity.

Device view aggregation logic improvements:

  • Updated the comment in Analysis.java to clarify that deviceViewSpecialProcess applies when all Aggregation Functions, UDTFs, and DIFF are present, not just Aggregation Functions and DIFF.
  • Modified the logic in SourceRewriter.java so that special processing for device views is triggered when UDTFs are present, in addition to existing conditions. This is achieved by checking for the UDTF function type in the relevant method.
  • Added FunctionType import in SourceRewriter.java to support the new UDTF check.

Code clarity and maintainability:

  • Renamed the method aggregationCannotUseMergeSort() to cannotUseAggMergeSort() in SourceRewriter.java for improved readability and accuracy. [1] [2]
  • Updated all method calls and logic to use the new method name and signature.

@sonarqubecloud
Copy link

@codecov
Copy link

codecov bot commented Aug 25, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 38.99%. Comparing base (1b377c0) to head (b279cf0).
⚠️ Report is 12 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff            @@
##             master   #16248   +/-   ##
=========================================
  Coverage     38.99%   38.99%           
  Complexity      198      198           
=========================================
  Files          4886     4886           
  Lines        319575   319616   +41     
  Branches      40342    40348    +6     
=========================================
+ Hits         124613   124630   +17     
- Misses       194962   194986   +24     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@JackieTien97 JackieTien97 merged commit ef0e45e into master Aug 26, 2025
19 of 20 checks passed
@JackieTien97 JackieTien97 deleted the FixUDTF branch August 26, 2025 03:57
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.

1 participant