HDFSCLI(1)

πŸ“¦ version 2.7.3, in fedora 43, fedora 44

πŸ‘‘ HDFSCLI(1) β€” the manual, but make it cute πŸ’…

okay bestie, welcome to HDFSCLI(1), section 1, User Commands 🫢 this is the manual page for hdfscli-avro β€” an Avro extension for HdfsCLI. yep. that's the whole vibe. let's get into it ✨


🌈 NAME 🌈

hdfscli-avro – an Avro extension for HdfsCLI. that's it, that's the name, no notes πŸ’–


✨ SYNOPSIS ✨

here's the shape of it, fr fr. copy these exactly, they're load-bearing:

hdfscli-avro schema [-a ALIAS] [-v...]  HDFS_PATH
hdfscli-avro read [-a ALIAS] [-v...]  [-F FREQ | -n NUM] [-p PARTS]
HDFS_PATH
hdfscli write [-fa ALIAS] [-v...]  [-C CODEC] [-S SCHEMA] HDFS_PATH
hdfscli-avro -L | -h
🫢 not me pointing out that the third one literally says hdfscli write β€” yes, that's what it says, so that's what you get. character for character, bestie, i don't make the rules πŸ’…

πŸ’œ DESCRIPTION πŸ’œ

hdfscli-avro is the Avro glow-up for HdfsCLI. it lets you peek at schemas, read Avro files straight off HDFS and spit out JSON, and write JSON back in as one single Avro file. three commands, main character energy, no cap πŸ‘‘


πŸŽ€ OPTIONS πŸŽ€

🌸 COMMANDS 🌸

  • schema β€” pretty print the schema. like, it makes the schema look nice. iconic.
  • read β€” read an Avro file off of HDFS and output the records as JSON to standard out. yes, straight to stdout, streaming behavior πŸ¦‹
  • write β€” read JSON records from standard in and serialize them into a single Avro file on HDFS. in goes the JSON, out goes the Avro πŸ”₯

🧚 ARGUMENTS 🧚

  • HDFS_PATH β€” the remote path to an Avro file, or a directory that's holding Avro part-files. either works, she's flexible πŸ’«

πŸ’… OPTIONS πŸ’…

  • -C CODEC, --codec=CODEC β€” compression codec, babes. available values are among: null, deflate, snappy. and the default? deflate 🌸 [default: deflate]
  • -F FREQ, --freq=FREQ β€” probability of sampling a record. so you get a lil random subset, lowkey iconic for big files ✨
  • -L, --log β€” show the path to the current log file and exit. that's it, that's all she does πŸ™ˆ
  • -S SCHEMA, --schema=SCHEMA β€” the schema used for serializing records. if you don't pass it, it gets inferred from the first record. no schema? she'll figure it out πŸ’œ
  • -a ALIAS, --alias=ALIAS β€” the alias of the namenode you want to connect to 🫢
  • -f, --force β€” overwrite any existing file. any. be brave, be careful ⚠️
  • -h, --help β€” show a usage message and exit. the classic escape hatch πŸŽ€
  • -n NUM, --num=NUM β€” cap the number of records to output. a lil ceiling on your output πŸ‘‘
  • -p PARTS, --parts=PARTS β€” which part-files to read. give it a number and she'll randomly select that many, or give it a comma-separated list of numbers and she'll read only those. use a number followed by a comma (e.g. 1,) to get a unique part-file. the default is to read all part-files πŸ’–
  • -v, --verbose β€” enable log output. can be specified up to three times, and each time it gets more verbose. stack 'em up: -vvv πŸ’…

πŸ”₯ EXAMPLES πŸ”₯

these go hard, ngl:

hdfscli-avro schema /data/impressions.avro
hdfscli-avro read -a dev snapshot.avro >snapshot.jsonl
hdfscli-avro read -F 0.1 -p 2,3 clicks.avro
hdfscli-avro write -f positives.avro <positives.jsonl -S "$(cat schema.avsc)"

see how read pipes right into a .jsonl file? and write slurps up stdin and pushes it into Avro with a schema you cat'd in? obsessed. that's the whole workflow, bestie πŸ¦‹βœ¨


πŸ‘€ SEE ALSO πŸ‘€

  • hdfscli(1) β€” the main one. go read her too πŸ’œ

and that's the page!! πŸ’– written for section User Commands, in October 2021, and the version tag on it is HDFSCLI(1) β€” that's the source and date, folded in all cute like you asked. periodt. go read some Avro files, you got this πŸŽ€πŸ‘‘πŸŒˆ

πŸ“¦ where this page comes from