Skip to content

Convert Excel to Parquet

You have an Excel workbook and want a Parquet file that other tools can read with its column types. Excel stores a type per cell; Parquet stores one type per column, so each column gets a single type on the way. It takes two nodes.

You'll use: File Input → File Output.

  1. 1Input
    File Input
    orders.xlsx · Excel
  2. 2Output
    File Output
    orders · Parquet

Sample data

Download orders.xlsx. It has two sheets. The first, Summary, holds one note. The second, Orders, holds the data. zip is stored as a number with the cell format 00000, so Excel shows 02134:

order_idorder_dateamountzip
ORD-12024-01-05250.0002134
ORD-22024-01-0699.9910001
ORD-32024-01-09100.0094105

Steps

  1. On Datasets, open Import options and set Excel sheet (name or 0-based index) to Orders. Then upload orders.xlsx. Ciaren imports one sheet per upload: without this setting it takes the first sheet, Summary.
  2. In a new flow, add File Input. Set File type to Excel and Dataset to orders.xlsx. The Dataset list only shows uploads of the selected file type.
  3. Add File Output. Set File type to Parquet (.parquet) and Dataset name to orders. Connect the two nodes and click Run.
  4. Open the run from Runs to download orders.

A workbook with a Summary sheet and an Orders sheet: only the named sheet becomes the dataset, and the Parquet file stores one type per column, with the zip that Excel shows as 02134 stored as the number 2134

Prefer to describe it?

With a provider key set up, upload the workbook with the Orders sheet selected as in step 1, open a blank flow in the same project and ask the Flow assistant, for example: "write this dataset as a Parquet file." Review the proposed nodes and settings, then choose Apply and save. We ran this prompt on the sample data; see what the assistant built. Its flow can differ from the steps above in node order and names, so check each setting. Pick the worksheet in Import options when you upload, as in step 1. The assistant never runs a flow, so click Run yourself.

Result

orders.parquet has 3 rows and these column types:

ColumnType in ParquetFirst value
order_idtextORD-1
order_datedatetime2024-01-05 00:00:00
amountdecimal (float)250.0
zipinteger2134

Check the result

Save the flow, click Preview and click Run preview on the File Input node. You should see 3 rows and the columns order_id, order_date, amount and zip. A single note column means the Summary sheet was imported: upload the file again with the sheet set.

Pitfalls

  • Re-uploading adds a version. Uploading orders.xlsx again creates version 2 of the dataset, and the File Input stays pinned to version 1. Pick the new version in its Version field.
  • Cell formats are not imported. The 00000 format only changes how Excel displays the zip, so Ciaren reads the number 2134, in runs and in both exports. To keep the leading zero, store the code as text in Excel (type '02134). Text cells stay text in runs and in both exports, and a column that mixes text and number cells becomes a text column. Text such as NA or N/A stays text too; only empty cells become missing values.
  • Dates gain a time. An Excel date becomes a datetime at midnight.
  • One sheet per dataset. Every upload of orders.xlsx becomes a version of the same dataset. To convert a second sheet as well, upload a copy of the workbook under another file name with that sheet set.

Exported Python

Click Export in the editor toolbar. The pandas and polars tabs show this code for the flow. It reads the original orders.xlsx, including the sheet you chose at upload, and writes orders.parquet. The pandas version needs openpyxl and pyarrow; the Polars version needs openpyxl.

python
import pandas as pd

df_orders = pd.read_excel('orders.xlsx', dtype=object, keep_default_na=False, na_values=[''], sheet_name='Orders')
# Columns with any text cell stay text (zip codes, IDs keep leading zeros).
df_orders = df_orders.apply(lambda col: col.where(col.isna(), col.astype(str)) if col.apply(isinstance, args=(str,)).any() else col.infer_objects())
df_orders.to_parquet('orders.parquet', index=False)

To go the other way, use a File Input with File type Parquet and a File Output with File type Excel (.xlsx) or CSV (.csv).

See also