Skip to content

suggest add table function generate_series and change the results of current version #9323

Closed

Description

@l1t1

Is your feature request related to a problem or challenge?

as #9315 mentioned, generate_series is alias of range, it's result does not include the upper bound. it results the problem of Portability from other DBMS.

Describe the solution you'd like

the result of generate_series is same as that of postgresql, the range() funciton keeps the current result

 select generate_series(1,3);
 generate_series
-----------------
               1
               2
               3

select * from generate_series(1,3);
 generate_series
-----------------
               1
               2
               3

Describe alternatives you've considered

No response

Additional context

No response

Activity

  1. l1t1 commented on Feb 23, 2024

    @l1t1
    Author

    databend's numbers function + 1 is similar with generate_series

    ctx.sql("select number+1 from numbers(3)")
    ┌──────────────┐
    │ (number + 1) │
    │    UInt64    │
    ├──────────────┤
    │            1 │
    │            2 │
    │            3 │
    └──────────────┘
  2. Lordworms commented on Feb 24, 2024

    @Lordworms
    Contributor

    I'm just wondering what is the purpose of datafusion to design in such a way. If this feature is needed, I can do this one.

  3. alamb commented on Feb 26, 2024

    @alamb
    Contributor

    Here is the duckdb syntax: https://duckdb.org/docs/sql/functions/nested.html#range-functions

    It looks to me like generate_series and range can be both scalar functions (return list) or table functions (return a table)

  4. alamb commented on Feb 26, 2024

    @alamb
    Contributor

    I think we should follow postgres or duckdb's syntax

  5. Lordworms commented on Feb 27, 2024

    @Lordworms
    Contributor

    take

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

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions