Skip to content

fix: Unparse random as rand for some dialects - #26009

Open
nuno-faria wants to merge 3 commits into
apache:mainfrom
nuno-faria:fix_unparser_random
Open

nuno-faria wants to merge 3 commits into
apache:mainfrom
nuno-faria:fix_unparser_random

Conversation

@nuno-faria

Copy link
Copy Markdown
Contributor

Which issue does this PR close?

Rationale for this change

Generate valid SQL for the dialects that do not support the random() function

What changes are included in this PR?

  • Updated the MySQL and BigQuery dialects.

What is the testing strategy for this PR?

Unit test.

Are there any user-facing changes?

No.

@github-actions github-actions Bot added the sql SQL Planner label Oct 3, 2026
@github-actions github-actions Bot added the core Core DataFusion crate label Oct 3, 2026
@codecov-commenter

codecov-commenter commented Oct 3, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 80.76923% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 82.65%. Comparing base (95a1961) to head (db42008).
⚠️ Report is 5 commits behind head on main.

Files with missing lines Patch % Lines
datafusion/sql/src/unparser/dialect.rs 33.33% 2 Missing and 2 partials ⚠️
datafusion/sql/src/unparser/expr.rs 95.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@           Coverage Diff            @@
##             main   #26009    +/-   ##
========================================
  Coverage   82.64%   82.65%            
========================================
  Files        1147     1147            
  Lines      445502   446113   +611     
  Branches   445502   446113   +611     
========================================
+ Hits       368179   368720   +541     
- Misses      54969    54999    +30     
- Partials    22354    22394    +40     

☔ View full report in Codecov by Harness.
📢 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.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@VVKot

VVKot commented Oct 3, 2026

Copy link
Copy Markdown

@nuno-faria maybe link inline to the MySQL/BigQuery docs describing their syntax?

@nuno-faria

Copy link
Copy Markdown
Contributor Author

@nuno-faria maybe link inline to the MySQL/BigQuery docs describing their syntax?

Good idea @VVKot, added.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core Core DataFusion crate sql SQL Planner

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Unparsing the random function generates invalid SQL for some dialects

3 participants