@@ -61,6 +61,83 @@ allTypesPlain =
6161 (unsafePerformIO (D. readParquet " ./tests/data/alltypes_plain.parquet" ))
6262 )
6363
64+ allTypesTinyPagesDimensions :: Test
65+ allTypesTinyPagesDimensions =
66+ TestCase
67+ ( assertEqual
68+ " allTypesTinyPages last few"
69+ (7300 , 13 )
70+ ( unsafePerformIO
71+ (fmap D. dimensions (D. readParquet " ./tests/data/alltypes_tiny_pages.parquet" ))
72+ )
73+ )
74+
75+ tinyPagesLast10 :: D. DataFrame
76+ tinyPagesLast10 =
77+ D. fromNamedColumns
78+ [ (" id" , D. fromList @ Int32 (reverse [6174 .. 6183 ]))
79+ , (" bool_col" , D. fromList @ Bool (Prelude. take 10 (cycle [False , True ])))
80+ , (" tinyint_col" , D. fromList @ Int32 [3 , 2 , 1 , 0 , 9 , 8 , 7 , 6 , 5 , 4 ])
81+ , (" smallint_col" , D. fromList @ Int32 [3 , 2 , 1 , 0 , 9 , 8 , 7 , 6 , 5 , 4 ])
82+ , (" int_col" , D. fromList @ Int32 [3 , 2 , 1 , 0 , 9 , 8 , 7 , 6 , 5 , 4 ])
83+ , (" bigint_col" , D. fromList @ Int64 [30 , 20 , 10 , 0 , 90 , 80 , 70 , 60 , 50 , 40 ])
84+ ,
85+ ( " float_col"
86+ , D. fromList @ Float [3.3 , 2.2 , 1.1 , 0 , 9.9 , 8.8 , 7.7 , 6.6 , 5.5 , 4.4 ]
87+ )
88+ ,
89+ ( " date_string_col"
90+ , D. fromList @ Text
91+ [ " 09/11/10"
92+ , " 09/11/10"
93+ , " 09/11/10"
94+ , " 09/11/10"
95+ , " 09/10/10"
96+ , " 09/10/10"
97+ , " 09/10/10"
98+ , " 09/10/10"
99+ , " 09/10/10"
100+ , " 09/10/10"
101+ ]
102+ )
103+ ,
104+ ( " string_col"
105+ , D. fromList @ Text [" 3" , " 2" , " 1" , " 0" , " 9" , " 8" , " 7" , " 6" , " 5" , " 4" ]
106+ )
107+ ,
108+ ( " timestamp_col"
109+ , D. fromList @ UTCTime
110+ [ UTCTime (fromGregorian 2010 9 10 ) (secondsToDiffTime 85384 )
111+ , UTCTime (fromGregorian 2010 9 10 ) (secondsToDiffTime 85324 )
112+ , UTCTime (fromGregorian 2010 9 10 ) (secondsToDiffTime 85264 )
113+ , UTCTime (fromGregorian 2010 9 10 ) (secondsToDiffTime 85204 )
114+ , UTCTime (fromGregorian 2010 9 9 ) (secondsToDiffTime 85144 )
115+ , UTCTime (fromGregorian 2010 9 9 ) (secondsToDiffTime 85084 )
116+ , UTCTime (fromGregorian 2010 9 9 ) (secondsToDiffTime 85024 )
117+ , UTCTime (fromGregorian 2010 9 9 ) (secondsToDiffTime 84964 )
118+ , UTCTime (fromGregorian 2010 9 9 ) (secondsToDiffTime 84904 )
119+ , UTCTime (fromGregorian 2010 9 9 ) (secondsToDiffTime 84844 )
120+ ]
121+ )
122+ , (" year" , D. fromList @ Int32 (replicate 10 2010 ))
123+ , (" month" , D. fromList @ Int32 (replicate 10 9 ))
124+ ]
125+
126+ allTypesTinyPagesLastFew :: Test
127+ allTypesTinyPagesLastFew =
128+ TestCase
129+ ( assertEqual
130+ " allTypesTinyPages dimensions"
131+ tinyPagesLast10
132+ ( unsafePerformIO
133+ -- Excluding doubles because they are weird to compare.
134+ ( fmap
135+ (D. takeLast 10 . D. exclude [" double_col" ])
136+ (D. readParquet " ./tests/data/alltypes_tiny_pages.parquet" )
137+ )
138+ )
139+ )
140+
64141allTypesPlainSnappy :: Test
65142allTypesPlainSnappy =
66143 TestCase
@@ -537,7 +614,12 @@ mtCars =
537614 (unsafePerformIO (D. readParquet " ./tests/data/mtcars.parquet" ))
538615 )
539616
540- -- Uncomment to run parquet tests.
541- -- Currently commented because they don't run with github CI
542617tests :: [Test ]
543- tests = [allTypesPlain, allTypesPlainSnappy, allTypesDictionary, mtCars]
618+ tests =
619+ [ allTypesPlain
620+ , allTypesPlainSnappy
621+ , allTypesDictionary
622+ , mtCars
623+ , allTypesTinyPagesLastFew
624+ , allTypesTinyPagesDimensions
625+ ]
0 commit comments