Is there a way to capture the raw size of the payload carried by a copy command issued ?
karthik
Vertica Customer ✭
Hello,
We are sending huge data-set as part of a copy command to vertica. We want to know for every copy command that succeeded or failed, what is the raw size (in bytes) of the copy command ?
Tagged:
0
Answers
The LOAD_STREAMS system table might contain what you're looking for:
https://vertica.com/docs/9.3.x/HTML/Content/Authoring/SQLReferenceManual/SystemTables/MONITOR/LOAD_STREAMS.htm
For example:
with current_load as
(select
load_start,
case when is_executing then ((DATEDIFF(second, load_start::TIMESTAMP, sysdate())) / 60)
else (load_duration_ms / 1000 / 60)
end as Load_so_far_Minutes,
load_duration_ms,
input_file_size_bytes,
(input_file_size_bytes/1024^3)::numeric(9,3) as input_file_size_bytes_GB,
unsorted_row_count,
accepted_row_count,
rejected_row_count,
read_bytes,
parse_complete_percent || '%' AS parse_complete_percent,
sorted_row_count,
sort_complete_percent || '%' AS sort_complete_percent
from load_streams
where load_start::timestamp > sysdate -2 and
stream_name like 'MY_STREAM_NAME%'
)
SELECT
TO_CHAR(read_bytes, '999,999,999,999,999') AS read_bytes,
TO_CHAR(read_bytes / Load_so_far_Minutes, '999,999,999,999,999') AS read_bytes_per_minute,
TO_CHAR(input_file_size_bytes, '999,999,999,999,999') AS input_file_size_bytes,
input_file_size_bytes_GB,
TO_CHAR(unsorted_row_count, '999,999,999,999,999') AS unsorted_row_count,
TO_CHAR(accepted_row_count, '999,999,999,999,999') AS accepted_row_count,
TO_CHAR(rejected_row_count, '999,999,999,999,999') AS rejected_row_count,
parse_complete_percent,
TO_CHAR(sorted_row_count, '999,999,999,999,999') AS sorted_row_count,
TO_CHAR(sorted_row_count / Load_so_far_Minutes, '999,999,999,999,999') AS sorted_row_count_per_Minute,
sort_complete_percent,
Load_so_far_Minutes::numeric(9,1)
FROM current_load
order by load_duration_ms desc
limit 100;
I believe that the size in INPUT_FILE_SIZE_BYTES includes all of field delimeters and special characters (i.e. line feeds). Plus it shows the compressed file size of the file is compressed.
If you want the raw size as Vertica defines it, I think you'd have to do something crazy like this?
Or, in my example, this is much easier:
Thanks. I was looking for something equivalent in 8.x vertica.