Line 1:
Line 1:
The Parquet file dump of the Open Food Facts database contains a variety of data in different format, such as string, list, struct, timestamp,...
The Parquet file dump of the Open Food Facts database contains a variety of data in different format, such as string, list, struct, timestamp,...
−
In this cheatsheet, we will learn how to use the Parquet dump using DuckDB to perform data analysis, by solving some of the most common use-cases asked by the community.
+
In this cheat sheet, we will learn how to use the Parquet dump using DuckDB to perform data analysis, by solving some of the most common use-cases asked by the community.
−
We assume that you've downloaded the <code>food.parquet</code> file locally, and that you've launched Duckdb CLI. (see [[Reusing Open Food Facts Data#Parquet file hosted on Hugging Face .28beta.29|Reusing Open Food Facts Data]])
+
We assume that you've downloaded the <code>food.parquet</code> file locally, and that you've launched DuckDB CLI. (see [[Reusing Open Food Facts Data#Parquet file hosted on Hugging Face .28beta.29|Reusing Open Food Facts Data]]).
+
+
==== Modify the type of output ====
+
By default, DuckDB adopts its own display mode. But this mode truncates the display when the output is too long. There are many others outputs, see [https://duckdb.org/docs/api/cli/output_formats.html DuckDB documentation about them].
+
+
==== Describe the data ====
+
It's interesting to have the whole list of fields and their characteristics.
+
.mode box -- comment: change display mode to nice table
+
describe select * from 'food.parquet';
==== Creating a new parquet file for my country ====
==== Creating a new parquet file for my country ====