Skip to content

Malloy is an experimental language for describing data relationships and transformations.

License

Notifications You must be signed in to change notification settings

malloydata/malloy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

author
Will Scullin
Mar 14, 2024
269fad7 · Mar 14, 2024
Mar 14, 2024
Mar 12, 2024
Mar 14, 2024
Nov 29, 2023
Mar 14, 2024
Jan 17, 2023
Mar 5, 2024
Mar 12, 2024
Jan 17, 2023
Feb 28, 2023
Sep 28, 2023
Dec 6, 2023
Mar 6, 2023
Mar 9, 2024
Jan 3, 2024
Nov 8, 2022
May 25, 2023
Aug 8, 2022
Aug 24, 2021
Jan 16, 2023
Mar 7, 2024
Jan 18, 2022
Sep 1, 2023
Sep 12, 2023
Mar 12, 2024
Mar 12, 2024
Mar 12, 2024
Mar 5, 2024
Mar 5, 2024
Mar 5, 2024
Mar 5, 2024
Sep 6, 2023

Repository files navigation

Malloy

Malloy is an experimental language for describing data relationships and transformations. It is both a semantic modeling language and a querying language that runs queries against a relational database. Malloy currently supports BigQuery and Postgres, as well as querying Parquet and CSV files via DuckDB.

Click here to try Malloy in your browser!


Installing Malloy

The easiest way to try Malloy is with our VS Code Extension, which provides a place to create Malloy models, execute queries, get help, and more. VS Code is a text editor and IDE (integrated development environment) that runs on your desktop or in your browser. A few ways to install the extension:

show_run

To get to know the Malloy language, follow our Quickstart.

Note: The Malloy VSCode Extension tracks a small amount of anonymous usage data. You can opt out in the extension settings. Learn more.

Join the Community

  • Join our Malloy Slack Community! Use this community to ask questions, meet other Malloy users, and share ideas with one another.
  • Use GitHub issues in this Repo to provide feedback, suggest improvements, report bugs, and start new discussions.

Resources

Documentation:

YouTube - Watch demos / walkthroughs of Malloy

Contributing

If you would like to work on Malloy, take a look at the instructions for developing Malloy.

To report security issues please see our security policy.

Malloy is not an officially supported Google product.

Syntax Example

Here is a simple example of a Malloy query:

run: bigquery.table('malloy-data.faa.flights') -> {
  where: origin ? 'SFO'
  group_by: carrier
  aggregate:
    flight_count is count()
    average_flight_time is flight_time.avg()
}

In SQL this would be expressed:

SELECT
   carrier,
   COUNT(*) as flight_count,
   AVG(flight_time) as average_flight_time
FROM `malloy-data.faa.flights`
WHERE origin = 'SFO'
GROUP BY carrier
ORDER BY flight_count desc         -- malloy automatically orders by the first aggregate

Learn more about the syntax and language features of Malloy in the Quickstart.