Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: influx inspect export parquet #25047

Open
wants to merge 8 commits into
base: master-1.x
Choose a base branch
from

Conversation

alespour
Copy link
Contributor

@alespour alespour commented Jun 7, 2024

Closes https://github.com/influxdata/edge/issues/672

This PR extends influx_inspect command export with Parquet output. The code in cmd/influx_inspect/export/parquet folder is Parquet exporter code and related code ported from idpe (command snapshot store tsm export), just the minimal required subset for the export.

New influx_inspect options:

  • -measurement - selects measurement to be exported required
  • -parquet - selects Parquet output instead of line protocol
  • -chunk-size - size, in bytes, to partition Parquet files (default 100000000)

Output file(s) are created in a folder specified via existing -out option. The limitations are:

  • -database, -retention and -measurement must be specified
  • only TSM files are exported (not WAL files, unlike when exporting to line protocol) - if requested, can be easily implemented
  • export to Parquet file(s) is done per each TSM file. The files are apparently not sorted by time of the contained data by the reading code. Therefore, neither are output files. So for example table-00001.parquet may contain older data than table-00000.parquet. Seems irrelevant for import.

  • I've read the contributing section of the project README.

@alespour alespour marked this pull request as ready for review June 11, 2024 08:34
@alespour alespour marked this pull request as draft June 12, 2024 09:04
@alespour
Copy link
Contributor Author

alespour commented Jun 12, 2024

Export example cmd:

influx_inspect export -datadir /var/lib/influxdb/data/ -waldir /var/lib/influxdb/wal/ -out /bigdata/export/ -database benchmark_db -retention autogen -measurement cpu -parquet

Import via telegraf:

[[inputs.file]]
   files = ["/bigdata/export/table-*.parquet"]
   name_override = "cpu"
   data_format = "parquet"
   tag_columns = ["datacenter","hostname","os","rack","region","service","team"]
   timestamp_column = "time"
   timestamp_format = "unix_ns"

telegraf --once

@alespour alespour marked this pull request as ready for review June 12, 2024 09:41
@powersj
Copy link
Contributor

powersj commented Jun 12, 2024

@davidby-influx could we get Stuart's review on this PR? While not urgent, it would be nice to keep up the momentum on this.

@alespour I have two comments:

  • In the README I'd rather see some examples of running with this new option + the required params
  • Is there a reason you are using arrow v14 and not v16? I assume that is copied over as well?

@alespour
Copy link
Contributor Author

alespour commented Jun 12, 2024

@powersj Yes, arrow v14 is used used in v2 exporter and it was just copied. I'll update the dep to v16. And add some examples of running the tool with Parquet output.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants