Skip to content

[docs]Add some working examples for functions in aggregate.rst #25194

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

KIRITOLTR
Copy link

Description

Adding some simple examples for functions in aggregate.rst.

Motivation and Context

For addressing the lack of working examples in functions docs. See #19830

Impact

Documentation.

Test Plan

Local doc builds. Some Screeshot:
c0e67e3d-ed4f-464e-a43d-bab573d93372

badbf4f8-6129-498e-8560-cd50d5eb617a

Contributor checklist

  • Please make sure your submission complies with our contributing guide, in particular code style and commit standards.
  • PR description addresses the issue accurately and concisely. If the change is non-trivial, a GitHub Issue is referenced.
  • Documented new properties (with its default value), SQL syntax, functions, or other functionality.
  • If release notes are required, they follow the release notes guidelines.
  • Adequate tests were added if applicable.
  • CI passed.
== NO RELEASE NOTE ==

Copy link
Contributor

@steveburnett steveburnett left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! (docs)

Pull branch, local doc build, looks good.

Thanks for all of these examples!

@github-project-automation github-project-automation bot moved this from 🆕 Unprioritized to ✅ Done in Presto Documentation May 27, 2025
Copy link
Contributor

@steveburnett steveburnett left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Checked the examples and found one that might need some work. The others seem good.


.. function:: khyperloglog_agg(x) -> KHyperLogLog
:noindex:

See :doc:`khyperloglog`.
::

SELECT cardinality(khyperloglog_agg(user_id)) AS approx_distinct_users
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This example when I tested it returns the following error:

Query 20250527_155203_00071_afft5 failed: line 1:20: Unexpected parameters (integer) for function khyperloglog_agg. Expected: khyperloglog_agg(E, T) E, T
SELECT cardinality(khyperloglog_agg(user_id)) AS approx_distinct_users
        FROM (
        VALUES (101), (102), (103), (101), (104)
        ) AS t(user_id)

Can you take a look and maybe fix this one, or delete this example if fixing it is complicated?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants