Urgent.News

What's breaking now, across hundreds of outlets.

Tech

Keep the CSV and reuse a working copy with Parquet and DuckDB

On a Windows PC with 16 GB of RAM, auditing a million-row CSV and writing Parquet took 91.1 seconds. A later run took 2.3 seconds to extract 10,000 rows from the prepared file. Here is how DIY AutoML keeps track of the original CSV, the working copy, and the data that goes into training. Japanese original Keep the original CSV and record the working copy The workflow keeps and audits the original…

On a Windows PC equipped with 16 GB of RAM, conducting an audit on a CSV file containing a million rows took approximately 91.1 seconds. Subsequently, extracting 10,000 rows from the pre-prepared file proved to be a quicker task, requiring just 2.3 seconds. The process of DIY AutoML meticulously tracks the original CSV, a working copy, and the data utilized for training.

The workflow maintains and scrutinizes the original CSV, optionally generating a working file, followed by the extraction and validation of the training data. The audit examines various aspects such as row counts, missing values, duplicate rows, and label counts. Subsequently, a conversion records the output row count, column types, and a SHA-256 hash of the source CSV.

Parquet files store data column-wise, which is advantageous for efficiency. DIY AutoML writes the data using Zstandard compression, thereby reducing the bytes stored and read. Apache Parquet provides an overview of this columnar storage format.

DuckDB, a columnar database engine, reads Parquet files directly and allows for limiting the read operations to the projected columns. If the row group statistics indicate that a particular group cannot satisfy a filter condition, DuckDB can effectively skip that group. Furthermore, a persistent .duckdb file can serve as a repository for tables that can be reused.

By default, the conversion process preserves the textual representation of data from each CSV field, thus retaining details such as leading zeros in identifiers. The --conversion-types numeric option can be employed to assign numerical types to feature columns, ensuring that their values can be precisely represented.

In the context of the Raisin dataset, which consists of 900 records, the workflow was applied to extract specific columns while retaining every row. The Raisin CSV comprises 900 records, focusing on area, perimeter, and the recorded variety. PowerShell commands were executed from the repository root to facilitate this extraction. Optional dependencies can be installed using the provided command.

Testing was conducted on a Windows PC equipped with a Core i5-14400 processor and 16 GB of RAM. The synthetic test dataset comprised a million rows with seven numeric features and a binary label. The audit and conversion processes encompassed all one million rows, while model comparisons utilized 10,000 extracted rows. The CSV file measured 36.2 MB, and the compressed Parquet file amounted to 18.9 MB.

Each stage of the process was timed, with the median of three runs recorded for elapsed time and peak memory usage. The audit of a CSV file with 1,000,000 input rows took 63.3 seconds and peaked at 169 MiB of memory. The process of converting the CSV to Parquet took 91.1 seconds and peaked at 186 MiB of memory. Extracting 10,000 output rows from the existing Parquet file took just 2.3 seconds and also peaked at 186 MiB of memory.

Comparing and evaluating five models using the 10,000 extracted rows required 10.4 seconds and peaked at 195 MiB of memory.

Rewritten by urgent.news; may contain errors — check the original.

Source: dev.to

Read the original at dev.to →

Report a problem with this story

More in Tech

Why I Built SwarmForge

Concept diagram: one lead, independent workspaces, a reviewable handoff. Starting a few coding agents is easy. Keeping track of what they changed takes more work.

Building TerraSignal with SwarmForge

Original synthetic illustration inspired by radar-style terrain views; not satellite data. TerraSignal is an Earth-observation platform built to compare environmental change in RADARSAT-2 imagery.

Registrar-Specific DNS APIs: One Interface for Tenant Provisioning and Cutover

Registrar-Specific DNS APIs: One Interface for Tenant Provisioning and Cutover A tenant's storefront cannot launch merely because a DNS write succeeded.

  • Consolidate registrar-specific DNS APIs into a single interface for tenant provisioning and cutover.
  • Each tenant subdomain requires a separate readiness decision despite reduced application work.
  • Ownership of domain registration, transfer, and renewal remains with the registrar.

More from Wednesday 25 November →