Repository navigation
Conversation
### What problem does this PR solve? Issue Number: N/A Related PR: apache#49210, apache#49048 Problem Summary: PRINTF is missing from master. Restore the implementation merged into the Hive SQL branch and adapt it to the current BE layout, primitive types and Nereids function parameters. Support mixed string and numeric arguments, constant columns, CHAR/VARCHAR/STRING and NULL propagation. Retain Decimal-to-Double coercion and report invalid formats or unsupported argument types. Add BE, FE and SQL regression tests. ### Release note Add PRINTF(format_string[, args...]) for printf-style string formatting. ### Check List (For Author) - Test: Regression test test_printf (output generation and comparison), 7 BE unit tests, 3 FE unit tests, ASAN BE/FE build, Checkstyle, clang-tidy, C++ formatting and build hygiene checks - Behavior changed: Yes. Register the PRINTF scalar function - Does this need documentation: No. PRINTF has an existing function reference (cherry picked from commit fcab5d6) Co-authored-by: happenlee <happenlee@selectdb.com>
HappenLee
requested review from
924060929,
englefly,
morrySnow and
starocean999
as code owners
October 8, 2026 06:32
Contributor
|
Thank you for your contribution to Apache Doris. Please clearly describe your PR:
|
8 of 10 tasks
HappenLee
added a commit
to apache/doris-website
that referenced
this pull request
Oct 8, 2026
The website currently documents `PRINTF` for dev, 4.x, and 3.x and claims support since 3.0.6, while the master implementation is being introduced in apache/doris#68772. Remove all six English and Chinese function reference pages and their sidebar, migration-slug, and last-update entries. ## Validation - Changed-link gate: passed with no errors; the six page-deletion notices were reviewed. - English/Chinese sync gate: passed with no findings. - Reference and JSON checks: passed; no remaining SQL `PRINTF` references, document paths, or sidebar entries. - `git diff --check`: passed. - Docusaurus content and route loading: passed for dev, 4.x, and 3.x in both English and Chinese; each locale has 4,582 routes and no `PRINTF` route. Neighboring function pages and all three sidebars load successfully. - Docusaurus English production build: passed for dev, 4.x, and 3.x (unaffected blog, community, releases, and course plugins excluded). - Full production build across changed versions and languages: pending in the PR's Build Check CI. ## Self-review - Goal: all `PRINTF` SQL function documentation is removed. - Scope: 13 files, with only the relevant deletions. - Information architecture: dev, 4.x, and 3.x are updated in both languages; older versions have no `PRINTF` reference pages. - Links and navigation: no remaining inbound links or redirect entries point to the removed pages; removed routes are intentionally retired without a replacement page. - Validation: the checks above cover document removal, mirrored versions/languages, and sidebar integrity. - Other correctness and usability issues: none found in the changed content. ## Versions - [x] dev - [x] 4.x - [x] 3.x - [ ] 2.1 or older (not covered by version/language sync gate) ## Languages - [x] Chinese - [x] English ## Docs Checklist - [x] Checked by AI - [ ] Test Cases Built (documentation removal; no new SQL examples) - [x] Updated required version and language counterparts, or explained why not - [x] If only one language changed, confirmed whether source/translation counterparts need sync (both languages updated)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What problem does this PR solve?
Related PR: #49210, #49048
Problem Summary:
printfis not registered on master. Its original implementation was merged intobranch-c108335-hive-sqlin #49210; the corresponding master PR #49048 was closed without merging.Restore the implementation from commit
fcab5d6bf213fca1ddd3e690d94e9ce4b7fa445aand adapt it to the current BE function layout and primitive types. For example,SELECT printf('%d-%s-%.2f', 100, 'test', 3.14)now returns100-test-3.14.The function accepts a format string followed by mixed string and numeric arguments. It uses
fmt::vsprintf, handles constant and ordinary columns, accepts CHAR/VARCHAR/STRING, propagates NULL, and retains the original Decimal-to-Double coercion. Invalid format strings and unsupported argument types produce an error.Add BE tests for formatting, constant column combinations and errors, FE tests for binding and type coercion, and regression coverage.
Release note
Add
PRINTF(format_string[, args...])for printf-style string formatting.Check List (For Author)
test_printf, generated output with-forceGenOutand then reran comparison; both passed.function_string_test.function_printf*tests and 3 FEPrintfTesttests passed.Validation used
ENABLE_PCH=OFFbecause the current toolchain reports an incompletewide::integerinstantiation in the existing PCH build. No build environment changes are included in this PR.Behavior changed:
Does this need documentation?
Check List (For Reviewer who merge this PR)