Skip to content

Commit 44a1e35

Browse files
authored
Merge pull request #166 from JuliaIO/mg/snappy-0.4
Add compat for `Snappy` v0.4
2 parents e90f477 + 82207c6 commit 44a1e35

File tree

8 files changed

+54
-31
lines changed

8 files changed

+54
-31
lines changed

.github/workflows/ci.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ on:
66
tags: ['*']
77
jobs:
88
test:
9+
timeout-minutes: 30
910
name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} - ${{ github.event_name }}
1011
runs-on: ${{ matrix.os }}
1112
strategy:

Artifacts.toml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
[julia_parcompat]
2+
git-tree-sha1 = "066eb71b5392a8edb036e6a66a92d9b94a9e7eed"
3+
lazy = true
4+
5+
[[julia_parcompat.download]]
6+
sha256 = "943ac718383a9bb1144e0edc88ec1c42f071e00d40728af7b18a213fd4da5d1c"
7+
url = "https://github.com/JuliaIO/parquet-compatibility/archive/3f7586f1b7f2a0c6b048791fb5f97c0b3df52e39.tar.gz"
8+
9+
[parcompat]
10+
git-tree-sha1 = "1e993c153d3df6b2039ea5df61aeea2cb5213753"
11+
lazy = true
12+
13+
[[parcompat.download]]
14+
sha256 = "895f382e65e4684335d6cbd2d682172d0923660f5525e0682112361305f05b64"
15+
url = "https://github.com/Parquet/parquet-compatibility/archive/2b47eac447c7a4a88247651a4065984db7b247ff.tar.gz"

Project.toml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ uuid = "626c502c-15b0-58ad-a749-f091afb673ae"
33
keywords = ["parquet", "julia", "columnar-storage"]
44
license = "MIT"
55
desc = "Julia implementation of parquet columnar file format reader and writer"
6-
version = "0.8.3"
6+
version = "0.8.4"
77

88
[deps]
99
CategoricalArrays = "324d7699-5711-5eae-9e2f-1d82baa6b597"
@@ -29,14 +29,16 @@ Decimals = "0.4"
2929
LittleEndianBase128 = "0.3"
3030
Missings = "0.3,0.4,1"
3131
SentinelArrays = "1"
32-
Snappy = "0.3"
32+
Snappy = "0.3, 0.4"
3333
Tables = "1.6"
3434
Thrift = "0.8"
3535
julia = "1.3"
3636

3737
[extras]
38+
Artifacts = "56f22d72-fd6d-98f1-02f0-08ddc0907c33"
39+
LazyArtifacts = "4af54fe1-eca0-43a8-85a7-787d91b784e3"
3840
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
3941
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
4042

4143
[targets]
42-
test = ["Test", "Random"]
44+
test = ["Artifacts", "LazyArtifacts", "Random", "Test"]

test/generate_artifacts.jl

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
using ArtifactUtils, Artifacts
2+
3+
add_artifact!(
4+
joinpath(@__DIR__, "..", "Artifacts.toml"),
5+
"parcompat",
6+
"https://github.com/Parquet/parquet-compatibility/archive/2b47eac447c7a4a88247651a4065984db7b247ff.tar.gz",
7+
force=true,
8+
lazy=true,
9+
)
10+
11+
add_artifact!(
12+
joinpath(@__DIR__, "..", "Artifacts.toml"),
13+
"julia_parcompat",
14+
"https://github.com/JuliaIO/parquet-compatibility/archive/3f7586f1b7f2a0c6b048791fb5f97c0b3df52e39.tar.gz",
15+
force=true,
16+
lazy=true,
17+
)

test/get_parcompat.jl

Lines changed: 0 additions & 19 deletions
This file was deleted.

test/runtests.jl

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
1-
include("get_parcompat.jl")
1+
using Parquet
2+
using Test
3+
using LazyArtifacts, Artifacts
4+
5+
# Note: readdir(...; join=true) requires Julia v1.4.
6+
const parcompat = joinpath(artifact"parcompat", readdir(artifact"parcompat")[1])
7+
const julia_parcompat = joinpath(artifact"julia_parcompat", readdir(artifact"julia_parcompat")[1])
8+
29
@testset "parquet tests" begin
310
include("test_load.jl")
411
include("test_codec.jl")

test/test_cursors.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,21 +50,21 @@ end
5050
function test_row_cursor_all_files()
5151
for encformat in ("SNAPPY", "GZIP", "NONE")
5252
for fname in ("nation", "customer")
53-
test_row_cursor(joinpath(@__DIR__, "parquet-compatibility", "parquet-testdata", "impala", "1.1.1-$encformat/$fname.impala.parquet"))
53+
test_row_cursor(joinpath(parcompat, "parquet-testdata", "impala", "1.1.1-$encformat/$fname.impala.parquet"))
5454
end
5555
end
5656
end
5757

5858
function test_batchedcols_cursor_all_files()
5959
for encformat in ("SNAPPY", "GZIP", "NONE")
6060
for fname in ("nation", "customer")
61-
test_batchedcols_cursor(joinpath(@__DIR__, "parquet-compatibility", "parquet-testdata", "impala", "1.1.1-$encformat/$fname.impala.parquet"))
61+
test_batchedcols_cursor(joinpath(parcompat, "parquet-testdata", "impala", "1.1.1-$encformat/$fname.impala.parquet"))
6262
end
6363
end
6464
end
6565

6666
function test_col_cursor_length()
67-
path = joinpath(@__DIR__, "parquet-compatibility", "parquet-testdata", "impala", "1.1.1-SNAPPY/nation.impala.parquet")
67+
path = joinpath(parcompat, "parquet-testdata", "impala", "1.1.1-SNAPPY/nation.impala.parquet")
6868
pq_file = Parquet.File(path)
6969
col_name = pq_file |> colnames |> first
7070
col_cursor = Parquet.ColCursor(pq_file, col_name)

test/test_load.jl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ end
9797

9898
function test_decode_all_pages()
9999
@testset "decode parquet-compatibility test files" begin
100-
testfolder = joinpath(@__DIR__, "parquet-compatibility")
100+
testfolder = parcompat
101101
for encformat in ("SNAPPY", "GZIP", "NONE")
102102
for fname in ("nation", "customer")
103103
testfile = joinpath(testfolder, "parquet-testdata", "impala", "1.1.1-$encformat", "$fname.impala.parquet")
@@ -107,7 +107,7 @@ function test_decode_all_pages()
107107
end
108108

109109
@testset "decode julia-parquet-compatibility test files" begin
110-
testfolder = joinpath(@__DIR__, "julia-parquet-compatibility")
110+
testfolder = julia_parcompat
111111
for encformat in ("ZSTD", "SNAPPY", "GZIP", "NONE")
112112
for fname in ("nation", "customer")
113113
testfile = joinpath(testfolder, "Parquet_Files", "$(encformat)_pandas_pyarrow_$(fname).parquet")
@@ -123,7 +123,7 @@ end
123123

124124
function test_load_all_pages()
125125
@testset "load parquet-compatibility test files" begin
126-
testfolder = joinpath(@__DIR__, "parquet-compatibility")
126+
testfolder = parcompat
127127
for encformat in ("SNAPPY", "GZIP", "NONE")
128128
for fname in ("nation", "customer")
129129
testfile = joinpath(testfolder, "parquet-testdata", "impala", "1.1.1-$encformat", "$fname.impala.parquet")
@@ -133,7 +133,7 @@ function test_load_all_pages()
133133
end
134134

135135
@testset "load julia-parquet-compatibility test files" begin
136-
testfolder = joinpath(@__DIR__, "julia-parquet-compatibility")
136+
testfolder = julia_parcompat
137137
for encformat in ("ZSTD", "SNAPPY", "GZIP", "NONE")
138138
for fname in ("nation", "customer")
139139
testfile = joinpath(testfolder, "Parquet_Files", "$(encformat)_pandas_pyarrow_$(fname).parquet")
@@ -323,7 +323,7 @@ end
323323

324324
function test_load_at_offset()
325325
@testset "load file at offset" begin
326-
testfolder = joinpath(@__DIR__, "parquet-compatibility")
326+
testfolder = parcompat
327327
testfile = joinpath(testfolder, "parquet-testdata", "impala", "1.1.1-NONE", "customer.impala.parquet")
328328
parquet_file = Parquet.File(testfile)
329329

0 commit comments

Comments
 (0)