Skip to content

Commit

Permalink
changed parquet sampler lua test for file size
Browse files Browse the repository at this point in the history
  • Loading branch information
elidwa committed Apr 5, 2024
1 parent b8e43c7 commit e12d891
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions scripts/selftests/parquet_sampler.lua
Original file line number Diff line number Diff line change
Expand Up @@ -32,19 +32,20 @@ runner.check(parquet_sampler ~= nil)

print('\n------------------\nTest01: parquetsampler sample \n------------------')

local in_file_size = getFileSize(in_file);
print("Input file size: " .. in_file_size .. " bytes")

local status = parquet_sampler:sample()
local size = getFileSize(out_file);
print("Output file size: " .. size .. " bytes")
local expected_size = 28487
runner.check(size == expected_size, "Expected output file size: " .. expected_size .. " bytes, but got: " .. size .. " bytes")
local out_file_size = getFileSize(out_file);
print("Output file size: " .. out_file_size .. " bytes")
runner.check(out_file_size > in_file_size, "Outpu file size is not greater than input file size: ")

print('\n------------------\nTest02: parquetsampler sample again \n------------------')

local status = parquet_sampler:sample()
local size = getFileSize(out_file);
print("Output file size: " .. size .. " bytes")
local expected_size = 28487
runner.check(size == expected_size, "Expected output file size: " .. expected_size .. " bytes, but got: " .. size .. " bytes")
status = parquet_sampler:sample()
new_out_file_size = getFileSize(out_file)
print("Output file size: " .. out_file_size .. " bytes")
runner.check(out_file_size == new_out_file_size, "Output file size has incorrectly changed: ")


-- There is no easy way to read parquet file in Lua, check the size of the output file
Expand Down

0 comments on commit e12d891

Please sign in to comment.