SmartQueryTools

Add Calculated Column to Parquet Files Online

Add a new column to Parquet files computed from an arithmetic expression over existing columns. No formulas, no code — just point and click.

How to add Calculated Column to Parquet files

  1. Drop your file onto the upload area. It is loaded into the in-browser engine and the first 200 rows are shown.
  2. Type a name for the new column. The default is "calculated".
  3. Build the expression. Pick a column or "constant" on the left, choose an operator (+, −, ×, ÷ or %), then pick a column or constant on the right. The two sides start on the first and second columns of the file.
  4. Click Calculate. The new column is added as the last column and the preview updates.
  5. Download the result in the same format you uploaded.

Your file is processed locally in your browser and is never uploaded. The free limit is 50 MB per file; larger files work if your device has the memory for them.

Worked example

A hardware shop exports its stock count and wants the value of stock on the shelf for each product line: units counted multiplied by unit cost. One line was not counted this week.

Input (Parquet)

Parquet file (binary, columnar) — shown as a table with its schema

skuitemunitsunit_cost
HW-101Wood screws 4x40 (box)384.25
HW-102Brass hinge pair127.5
HW-103Wall plugs (100)02.75
HW-104Masking tape 24mmNULL3.25
HW-105Sandpaper P120 (10)255.75

Schema: sku VARCHAR, item VARCHAR, units BIGINT, unit_cost DOUBLE

Settings

  • New column name: stock_value
  • Expression: units × unit_cost

Result

skuitemunitsunit_coststock_value
HW-101Wood screws 4x40 (box)384.25161.5
HW-102Brass hinge pair127.590
HW-103Wall plugs (100)02.750
HW-104Masking tape 24mmNULL3.25NULL
HW-105Sandpaper P120 (10)255.75143.75

Each row multiplies its own units by its own unit_cost, and the result is appended as stock_value. Wall plugs have a real count of 0, so their value is 0. Masking tape has no count at all, so its value is NULL, not 0: any arithmetic with a NULL operand gives NULL. Run Fill Empty Values first if a blank count should be treated as zero.

Working with Parquet files

Parquet columns arrive with their stored types, so there is no guessing step. INT32 and INT64 columns, FLOAT, DOUBLE and DECIMAL columns can all be combined. The result type follows the engine's rules: whole number plus whole number stays an integer, and anything involving a DOUBLE becomes DOUBLE. Division always returns a decimal value, so 7 ÷ 2 gives 3.5 even when both columns are integers.

DECIMAL columns, common in finance exports from Spark or dbt, keep exact decimal arithmetic for addition, subtraction and multiplication, so cents do not drift. Integer overflow is checked, not wrapped. Multiplying two very large INT64 values stops with an out-of-range error instead of giving a wrong number. Cast one side to DOUBLE with Cast Column Types if you hit that. Struct and list columns cannot be used as operands. Flatten or extract the nested field into its own column first. The output Parquet file keeps every original column type unchanged and adds the new column at the end of the schema.

Frequently Asked Questions

What type will the new Parquet column have?

It depends on the operands. INT64 + INT64 stays an integer, DECIMAL × DECIMAL stays DECIMAL, and division or anything involving a DOUBLE gives DOUBLE. You can check the type in the Parquet Viewer after downloading.

Can I use a field inside a struct column in the calculation?

Not directly. The column pickers list top-level columns only. Use Flatten or the SQL Query tool to pull the nested field out into its own column, then run Calculate Column on it.

Can I use more than two operands or brackets in one expression?

No. Each run applies one operator to two operands, which can be columns or constants. Every run starts from the file you uploaded, so to chain steps, download the result, drop it back in and calculate again. For longer formulas, use the SQL Query tool.

What happens if I divide by zero?

The calculation does not stop. Rows where the divisor is zero get an empty (NULL) result, for both ÷ and %, whatever the column types. Every format writes it the same way, as an empty value.

How does the % operator work?

It is modulo, the remainder after division, not percent. 17 % 5 gives 2, and the sign follows the left operand, so -5 % 3 gives -2. To get a percentage, divide one column by another, then multiply the result by the constant 100 in a second run.

Related Tools

Round Numbers in Parquet Files Online

Round numeric columns in Parquet files to any number of decimal places directly in your browser. Set precision per column with a simple slider — no upload required.

Add Conditional Column to Parquet Files Online

Add a new column to Parquet files based on an if/else condition directly in your browser. Set a value for rows that match and a different value for rows that don't — no upload required.

Aggregate Parquet Files Online

Group and aggregate Parquet files by any column directly in your browser. Calculate sum, average, min, max, and count for any numeric column — no upload required.

Add Calculated Column to CSV Files Online

Add a new column to CSV files computed from an arithmetic expression over existing columns. No formulas, no code — just point and click.

Add Calculated Column to Excel Files Online

Add a new column to Excel files computed from an arithmetic expression over existing columns. No formulas, no code — just point and click.

Add Calculated Column to JSON Files Online

Add a new column to JSON files computed from an arithmetic expression over existing columns. No formulas, no code — just point and click.

Parquet Viewer Online

View and inspect Parquet files directly in your browser. Browse rows, check column names and data types — no upload required, your data stays on your device.

Convert Parquet to CSV Online

Convert Parquet files to CSV format directly in your browser. No upload required — your data never leaves your device.