Skip to content

fix(outputs.parquet): Write null instead of panicking on a type mismatch - #19554

Open
81reap wants to merge 1 commit into
influxdata:masterfrom
81reap:parquet-03-no-panic-type-mismatch
Open

fix(outputs.parquet): Write null instead of panicking on a type mismatch#19554
81reap wants to merge 1 commit into
influxdata:masterfrom
81reap:parquet-03-no-panic-type-mismatch

Conversation

@81reap

@81reap 81reap commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

Parquet files have fixed schemas once created. A value that didn't match the column schema would panic on the output flush goroutine (eg :: (1) demo k-1i (2) demo,k=v other=2i). Since this is uncaught, it would crash Telegraf.

Now values that don't fit the column schema are logged as null and one per column without crashing. The record batch is now also released when the write fails, which previously leaked its arrow buffers.

Checklist

Related issues

resolves # security issue + #19563

@telegraf-tiger telegraf-tiger Bot added fix pr to fix corresponding bug plugin/output 1. Request for new output plugins 2. Issues/PRs that are related to out plugins labels Aug 26, 2026
@srebhan

srebhan commented Aug 26, 2026

Copy link
Copy Markdown
Member

Can you please base this on master (or #19553 if required) instead of basing it on #19552 so we can easier review and merge this PR independent from #19552?

@srebhan srebhan self-assigned this Aug 26, 2026
Parquet files have fixed schemas once created. A value that didn't match the column schema would panic on the output flush goroutine (eg :: (1) `demo k-1i` (2) `demo,k=v other=2i`). Since this is uncaught, it would crash Telegraf.

Now values that don't fit the column schema are logged as null and one per column without crashing. The record batch is now also released when the write fails, which previously leaked its arrow buffers.
@81reap
81reap force-pushed the parquet-03-no-panic-type-mismatch branch from 15c1ffc to 8d89f84 Compare August 26, 2026 18:35
@81reap
81reap marked this pull request as ready for review August 26, 2026 18:35
@srebhan

srebhan commented Aug 26, 2026

Copy link
Copy Markdown
Member

To be honest I would rather drop the metric altogether or start a new file with the alternative scheme. The latter would require that we keep track of the schema of each file and assign the metric to the corresponding file matching the scheme. This would make things more complicated I guess.

@telegraf-tiger

Copy link
Copy Markdown
Contributor

Download PR build artifacts for linux_amd64.tar.gz, darwin_arm64.tar.gz, and windows_amd64.zip.
Downloads for additional architectures and packages are available below.

⚠️ This pull request increases the Telegraf binary size by 7.28 % for linux amd64 (new size: 330.7 MB, nightly size 308.2 MB)

📦 Click here to get additional PR build artifacts

Artifact URLs

. DEB . RPM . TAR . GZ . ZIP
amd64.deb aarch64.rpm darwin_amd64.tar.gz windows_amd64.zip
arm64.deb armel.rpm darwin_arm64.tar.gz windows_arm64.zip
armel.deb armv6hl.rpm freebsd_amd64.tar.gz windows_i386.zip
armhf.deb i386.rpm freebsd_armv7.tar.gz
i386.deb ppc64le.rpm freebsd_i386.tar.gz
mips.deb riscv64.rpm linux_amd64.tar.gz
mipsel.deb s390x.rpm linux_arm64.tar.gz
ppc64el.deb x86_64.rpm linux_armel.tar.gz
riscv64.deb linux_armhf.tar.gz
s390x.deb linux_i386.tar.gz
linux_mips.tar.gz
linux_mipsel.tar.gz
linux_ppc64le.tar.gz
linux_riscv64.tar.gz
linux_s390x.tar.gz

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fix pr to fix corresponding bug plugin/output 1. Request for new output plugins 2. Issues/PRs that are related to out plugins

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants