Skip to content

Stream decompress ​

Unpacks an archive delivered as ViaFileStream (ZIP, GZip, TAR, TAR.GZ, RAR, 7-Zip) and emits every contained file as its own ViaFileStream. The entries of one archive can form a batch.

Pins ​

PinKindTypesDescription
InputinputViaducta.Plugins.Files.Types.ViaFileStreamThe archive.
OutputoutputViaducta.Plugins.Files.Types.ViaFileStreamCalled once per file in the archive.

Configuration ​

FieldTypeDefaultDescription
AutoDetectCompressionbooleantruetrue: choose the format from the file name (ViaFileStream.Name); CompressionType is ignored.
CompressionTypedropdown: 0 GZip, 1 Zip, 2 Tar, 3 TarGz, 4 Rar, 5 SevenZip0Format used when AutoDetectCompression is false.
ArchivePasswordstringPassword for encrypted archives (Zip, Rar, 7-Zip).
BatchModedropdown: 1 Auto, 2 Always, 3 Never1Whether the entries of one archive form a batch for batch consumers (Stream compress, Write file, Build array, ...). Auto: only if the input file is not already in a batch; inside a batch (e.g. a file read by Read file) the entries stay in that batch. Always: a child batch per archive (label = archive name). Never: no batch.

Behaviour ​

  • Auto detection by file name ending, case-insensitive: .tar.gz / .tgz → TarGz, .gz → GZip, .zip → Zip, .tar → Tar, .7z / .7zip → SevenZip, .rar → Rar. Any other name raises "Cannot detect archive format".
  • Every file entry (directories are skipped) is decompressed into memory, one at a time, and emitted as a ViaFileStream with Name = entry path inside the archive (may contain folders, e.g. data/a.csv), Extension = last extension of the name, Size and Stream positioned at 0. A GZip entry gets the archive name without .gz.
  • The archive boundary is the batch.
  • When a batch is opened (BatchMode) it ends after the last entry was processed downstream: consumers commit then; an error that reaches the plugin fails the batch and they roll back. An archive without files emits nothing and opens no batch.
  • The input stream must be seekable.

Notes ​

  • FilePath and dates of the emitted records are empty.
  • Each entry is held in memory while it is processed; TarGz unpacks the whole tar into memory first.

Example ​

json
{ "AutoDetectCompression": true, "ArchivePassword": "" }

Collect files → Read file (Input) → Stream decompress → Write file

Viaducta documentation