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

Add basic AVRO files (translated copies of the parquet testing files to avro) #62

Merged
merged 4 commits into from
Sep 9, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions data/avro/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
This directory contains AVRO files corresponding to the parquet testing files at https://github.com/apache/parquet-testing/blob/master/data/

These files were created by using spark using the commands from https://gist.github.com/Igosuki/324b011f40185269d3fc552350d21744

Roughly:
```scala
import com.github.mrpowers.spark.daria.sql.DariaWriters
import org.apache.hadoop.fs.FileSystem
import org.apache.hadoop.fs.Path
import org.apache.hadoop.conf.Configuration
import org.apache.commons.io.FilenameUtils

val fileGlobs = sc.getConf.get("spark.driver.globs")
val dest = sc.getConf.get("spark.driver.out")

val fs = FileSystem.get(new Configuration(true));
val status = fs.globStatus(new Path(fileGlobs))
for (fileStatus <- status) {
val path = fileStatus.getPath().toString()
try {
val dfin = spark.read.format("parquet").load(path)
val fileName = fileStatus.getPath().getName();
val fileNameWithOutExt = FilenameUtils.removeExtension(fileName);
val destination = s"${dest}/${fileNameWithOutExt}.avro"
println(s"Converting $path to avro at $destination")
DariaWriters.writeSingleFile(
df = dfin,
format = "avro",
sc = spark.sparkContext,
tmpFolder = s"/tmp/dw/${fileName}",
filename = destination
)
} catch {
case e: Throwable => println(s"failed to convert $path : ${e.getMessage}")
}
}
```
Binary file added data/avro/alltypes_dictionary.avro
Binary file not shown.
Binary file added data/avro/alltypes_plain.avro
Binary file not shown.
Binary file added data/avro/alltypes_plain.snappy.avro
Binary file not shown.
Binary file added data/avro/binary.avro
Binary file not shown.
Binary file added data/avro/datapage_v2.snappy.avro
Binary file not shown.
Binary file added data/avro/dict-page-offset-zero.avro
Binary file not shown.
Binary file added data/avro/fixed_length_decimal.avro
Binary file not shown.
Binary file added data/avro/fixed_length_decimal_legacy.avro
Binary file not shown.
Binary file added data/avro/int32_decimal.avro
Binary file not shown.
Binary file added data/avro/int64_decimal.avro
Binary file not shown.
Binary file added data/avro/list_columns.avro
Binary file not shown.
Binary file added data/avro/nested_lists.snappy.avro
Binary file not shown.
Binary file added data/avro/nonnullable.impala.avro
Binary file not shown.
Binary file added data/avro/nullable.impala.avro
Binary file not shown.
Binary file added data/avro/nulls.snappy.avro
Binary file not shown.
Binary file added data/avro/repeated_no_annotation.avro
Binary file not shown.
Binary file added data/avro/single_nan.avro
Binary file not shown.