2525import java .io .IOException ;
2626import java .io .InputStream ;
2727import java .io .InputStreamReader ;
28+ import java .util .zip .GZIPInputStream ;
2829import java .net .URISyntaxException ;
2930import java .nio .charset .StandardCharsets ;
3031import java .util .ArrayList ;
@@ -66,7 +67,7 @@ public void testReadAlpAradeParquet() throws IOException {
6667 int expectedRows = 15000 ;
6768
6869 // Read expected values from CSV
69- double [][] expected = readExpectedCsv ("/alp_arade_expect.csv" , columnNames .length , expectedRows );
70+ double [][] expected = readExpectedCsv ("/alp_arade_expect.csv.gz " , columnNames .length , expectedRows );
7071
7172 // Read parquet file using GroupReadSupport
7273 List <Group > rows = readParquetGroups (parquetPath );
@@ -109,7 +110,7 @@ public void testReadAlpSpotify1Parquet() throws IOException {
109110 int expectedRows = 15000 ;
110111
111112 // Read expected values from CSV
112- double [][] expected = readExpectedCsv ("/alp_spotify1_expect.csv" , columnNames .length , expectedRows );
113+ double [][] expected = readExpectedCsv ("/alp_spotify1_expect.csv.gz " , columnNames .length , expectedRows );
113114
114115 // Read parquet file using GroupReadSupport
115116 List <Group > rows = readParquetGroups (parquetPath );
@@ -141,7 +142,7 @@ public void testReadAlpJavaAradeParquet() throws IOException {
141142 String [] columnNames = {"value1" , "value2" , "value3" , "value4" };
142143 int expectedRows = 15000 ;
143144
144- double [][] expected = readExpectedCsv ("/alp_arade_expect.csv" , columnNames .length , expectedRows );
145+ double [][] expected = readExpectedCsv ("/alp_arade_expect.csv.gz " , columnNames .length , expectedRows );
145146
146147 List <Group > rows = readParquetGroups (parquetPath );
147148 assertEquals ("Row count should match" , expectedRows , rows .size ());
@@ -180,7 +181,7 @@ public void testReadAlpJavaSpotify1Parquet() throws IOException {
180181 };
181182 int expectedRows = 15000 ;
182183
183- double [][] expected = readExpectedCsv ("/alp_spotify1_expect.csv" , columnNames .length , expectedRows );
184+ double [][] expected = readExpectedCsv ("/alp_spotify1_expect.csv.gz " , columnNames .length , expectedRows );
184185
185186 List <Group > rows = readParquetGroups (parquetPath );
186187 assertEquals ("Row count should match" , expectedRows , rows .size ());
@@ -209,7 +210,7 @@ public void testReadAlpFloatAradeParquet() throws IOException {
209210 String [] columnNames = {"value1" , "value2" , "value3" , "value4" };
210211 int expectedRows = 15000 ;
211212
212- float [][] expected = readExpectedCsvFloat ("/alp_float_arade_expect.csv" , columnNames .length , expectedRows );
213+ float [][] expected = readExpectedCsvFloat ("/alp_float_arade_expect.csv.gz " , columnNames .length , expectedRows );
213214
214215 List <Group > rows = readParquetGroups (parquetPath );
215216 assertEquals ("Row count should match" , expectedRows , rows .size ());
@@ -248,7 +249,7 @@ public void testReadAlpFloatSpotify1Parquet() throws IOException {
248249 };
249250 int expectedRows = 15000 ;
250251
251- float [][] expected = readExpectedCsvFloat ("/alp_float_spotify1_expect.csv" , columnNames .length , expectedRows );
252+ float [][] expected = readExpectedCsvFloat ("/alp_float_spotify1_expect.csv.gz " , columnNames .length , expectedRows );
252253
253254 List <Group > rows = readParquetGroups (parquetPath );
254255 assertEquals ("Row count should match" , expectedRows , rows .size ());
@@ -277,7 +278,7 @@ public void testReadAlpJavaFloatAradeParquet() throws IOException {
277278 String [] columnNames = {"value1" , "value2" , "value3" , "value4" };
278279 int expectedRows = 15000 ;
279280
280- float [][] expected = readExpectedCsvFloat ("/alp_float_arade_expect.csv" , columnNames .length , expectedRows );
281+ float [][] expected = readExpectedCsvFloat ("/alp_float_arade_expect.csv.gz " , columnNames .length , expectedRows );
281282
282283 List <Group > rows = readParquetGroups (parquetPath );
283284 assertEquals ("Row count should match" , expectedRows , rows .size ());
@@ -316,7 +317,7 @@ public void testReadAlpJavaFloatSpotify1Parquet() throws IOException {
316317 };
317318 int expectedRows = 15000 ;
318319
319- float [][] expected = readExpectedCsvFloat ("/alp_float_spotify1_expect.csv" , columnNames .length , expectedRows );
320+ float [][] expected = readExpectedCsvFloat ("/alp_float_spotify1_expect.csv.gz " , columnNames .length , expectedRows );
320321
321322 List <Group > rows = readParquetGroups (parquetPath );
322323 assertEquals ("Row count should match" , expectedRows , rows .size ());
@@ -368,9 +369,10 @@ private void verifyAlpEncoding(Path path) throws IOException {
368369 */
369370 private double [][] readExpectedCsv (String resourcePath , int numColumns , int expectedRows ) throws IOException {
370371 double [][] columns = new double [numColumns ][expectedRows ];
371- try (InputStream is = getClass ().getResourceAsStream (resourcePath );
372+ try (InputStream raw = getClass ().getResourceAsStream (resourcePath );
373+ InputStream is = new GZIPInputStream (raw );
372374 BufferedReader br = new BufferedReader (new InputStreamReader (is , StandardCharsets .UTF_8 ))) {
373- assertNotNull ("CSV resource not found: " + resourcePath , is );
375+ assertNotNull ("CSV resource not found: " + resourcePath , raw );
374376
375377 // Skip header
376378 String header = br .readLine ();
@@ -397,9 +399,10 @@ private double[][] readExpectedCsv(String resourcePath, int numColumns, int expe
397399 */
398400 private float [][] readExpectedCsvFloat (String resourcePath , int numColumns , int expectedRows ) throws IOException {
399401 float [][] columns = new float [numColumns ][expectedRows ];
400- try (InputStream is = getClass ().getResourceAsStream (resourcePath );
402+ try (InputStream raw = getClass ().getResourceAsStream (resourcePath );
403+ InputStream is = new GZIPInputStream (raw );
401404 BufferedReader br = new BufferedReader (new InputStreamReader (is , StandardCharsets .UTF_8 ))) {
402- assertNotNull ("CSV resource not found: " + resourcePath , is );
405+ assertNotNull ("CSV resource not found: " + resourcePath , raw );
403406
404407 // Skip header
405408 String header = br .readLine ();
0 commit comments