| 203 | |
| 204 | |
| 205 | def test_orcfile_empty(datadir): |
| 206 | from pyarrow import orc |
| 207 | |
| 208 | table = orc.ORCFile(datadir / "TestOrcFile.emptyFile.orc").read() |
| 209 | assert table.num_rows == 0 |
| 210 | |
| 211 | expected_schema = pa.schema([ |
| 212 | ("boolean1", pa.bool_()), |
| 213 | ("byte1", pa.int8()), |
| 214 | ("short1", pa.int16()), |
| 215 | ("int1", pa.int32()), |
| 216 | ("long1", pa.int64()), |
| 217 | ("float1", pa.float32()), |
| 218 | ("double1", pa.float64()), |
| 219 | ("bytes1", pa.binary()), |
| 220 | ("string1", pa.string()), |
| 221 | ("middle", pa.struct( |
| 222 | [("list", pa.list_( |
| 223 | pa.struct([("int1", pa.int32()), |
| 224 | ("string1", pa.string())]))) |
| 225 | ])), |
| 226 | ("list", pa.list_( |
| 227 | pa.struct([("int1", pa.int32()), |
| 228 | ("string1", pa.string())]) |
| 229 | )), |
| 230 | ("map", pa.map_(pa.string(), |
| 231 | pa.struct([("int1", pa.int32()), |
| 232 | ("string1", pa.string())]) |
| 233 | )), |
| 234 | ]) |
| 235 | assert table.schema == expected_schema |
| 236 | |
| 237 | |
| 238 | def test_filesystem_uri(tmpdir): |