GithubHelp home page GithubHelp logo

Comments (7)

max-sixty avatar max-sixty commented on May 19, 2024 1

Thanks for doing the list!

We now have table as of today!

And then I expect they'll be a long list of simple functions like stddev etc.

Those could be PRQL functions rather than written in rust, since they'll generally transpile to `func(foo)‘

from prql.

charlie-sanders avatar charlie-sanders commented on May 19, 2024 1

I'm all for making them PRQL functions, easier to share across implementations.

from prql.

charlie-sanders avatar charlie-sanders commented on May 19, 2024 1

Yes agreed, I'll update it.

from prql.

charlie-sanders avatar charlie-sanders commented on May 19, 2024

Closing this till we get a full list which can put in the docs somewhere.

from prql.

max-sixty avatar max-sixty commented on May 19, 2024

OK — feel free to PR a partial list for the meantime, and if you have the prql code then awesome (re your screenshots on discord). Thanks @qorrect

from prql.

charlie-sanders avatar charlie-sanders commented on May 19, 2024

Ok will do, I'm hoping to provide a PR for the standard library below, and a bunch of queries for testing, I'm not sure the right place for them so I'll let you place them.

# Aggregate Functions

func min column = f"MIN({column})"
func max column = f"MAX({column})"
func sum column = f"SUM({column})"
func avg column = f"AVG({column})"
func stddev column = f"STDDEV({column})"
func average column = f"AVG({column})"
func count = f"COUNT(*)"
func count column = f"COUNT({column})"
func count_distinct column = f"COUNT(DISTINCT `{column}`)"

# Casting functions

func float column = f'CAST({column} AS FLOAT)'
func int column = f'CAST({column} AS INT)'
func string column = f'CAST({column} AS CHAR)'
func date column = f'CAST({column} AS DATE)'
func datetime column = f'CAST({column} AS DATETIME)'
func timestamp column = f'CAST({column} AS TIMESTAMP)'
func time column = f'CAST({column} AS TIME)'
func boolean column = f'CAST({column} AS BOOLEAN)'
func decimal column = f'CAST({column} AS DECIMAL)'
func double column = f'CAST({column} AS DOUBLE)'

from null

from prql.

max-sixty avatar max-sixty commented on May 19, 2024

That's great! We could add this to a file functions.pest initially? I'm sure it'll move around but I'm very up for adding it and then we can build on it.

For the Casting — I though the plan for as that we had in discord was good? So it would just be a single func, if you agree...

from prql.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.