You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Feb 10, 2023. It is now read-only.
First, the argument to --output-format does not seem to be validated: --output-format foo will still work and give the default format. Second, it seems the argument is case-sensitive; CSV works but csv silently gives the default. It would be nice if I could use lower case.
Third, it seems there may be some byte vs. string / encoding issues, as many strings come out as the Python repr for binary data (b'...').
Here is the Athena ELB log example database:
athena --execute "SELECT * FROM "sampledb"."elb_logs" limit 3;"
athena --execute "SELECT * FROM "sampledb"."elb_logs" limit 3;" --output-format CSV
"b'request_timestamp'","b'elb_name'","b'request_ip'","b'request_port'","b'backend_ip'","b'backend_port'","b'request_processing_time'","b'backend_processing_time'","b'client_response_time'","b'elb_response_code'","b'backend_response_code'","b'received_bytes'","b'sent_bytes'","b'request_verb'","b'url'","b'protocol'","b'user_agent'","b'ssl_cipher'","b'ssl_protocol'"
"b'2015-01-06T16:00:00.516940Z'","b'elb_demo_003'","b'241.93.49.158'","b'1459'","b'172.34.104.223'","b'443'","b'7.13E-4'","b'4.53E-4'","b'0.001112'","b'200'","b'200'","b'0'","b'744'","b'GET'","b'http://www.example.com/articles/194'","b'HTTP/1.1'","b'""Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.111 Safari/537.36""'","b'-'","b'-'"
"b'2015-01-06T16:00:00.902953Z'","b'elb_demo_008'","b'240.124.85.193'","b'17382'","b'172.50.75.155'","b'443'","b'7.1E-4'","b'6.09E-4'","b'0.001432'","b'200'","b'200'","b'0'","b'329'","b'GET'","b'http://www.example.com/images/813'","b'HTTP/1.1'","b'""Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.111 Safari/537.36""'","b'-'","b'-'"
"b'2015-01-06T16:00:01.206255Z'","b'elb_demo_005'","b'248.193.50.89'","b'32739'","b'172.32.214.237'","b'80'","b'3.2E-4'","b'4.37E-4'","b'0.001608'","b'200'","b'200'","b'0'","b'4740'","b'GET'","b'http://www.example.com/images/692'","b'HTTP/1.1'","b'""Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/602.1.50 (KHTML, like Gecko) Version/10.0 Safari/602.1.50""'","b'-'","b'-'"
It's not clear what --output-format CSV_HEADER supposed to do, but it's adding a duplicate header:
"b'request_timestamp'","b'elb_name'","b'request_ip'","b'request_port'","b'backend_ip'","b'backend_port'","b'request_processing_time'","b'backend_processing_time'","b'client_response_time'","b'elb_response_code'","b'backend_response_code'","b'received_bytes'","b'sent_bytes'","b'request_verb'","b'url'","b'protocol'","b'user_agent'","b'ssl_cipher'","b'ssl_protocol'"
"b'request_timestamp'","b'elb_name'","b'request_ip'","b'request_port'","b'backend_ip'","b'backend_port'","b'request_processing_time'","b'backend_processing_time'","b'client_response_time'","b'elb_response_code'","b'backend_response_code'","b'received_bytes'","b'sent_bytes'","b'request_verb'","b'url'","b'protocol'","b'user_agent'","b'ssl_cipher'","b'ssl_protocol'"
"b'2015-01-01T08:00:00.516940Z'","b'elb_demo_009'","b'240.136.98.149'","b'25858'","b'172.51.67.62'","b'8888'","b'9.99E-4'","b'8.11E-4'","b'0.001561'","b'200'","b'200'","b'0'","b'428'","b'GET'","b'https://www.example.com/articles/746'","b'HTTP/1.1'","b'""Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/602.1.50 (KHTML, like Gecko) Version/10.0 Safari/602.1.50""'","b'DHE-RSA-AES128-SHA'","b'TLSv1.2'"
"b'2015-01-01T08:00:00.902953Z'","b'elb_demo_008'","b'244.46.184.108'","b'27758'","b'172.31.168.31'","b'443'","b'6.39E-4'","b'0.001471'","b'3.73E-4'","b'200'","b'200'","b'0'","b'4231'","b'GET'","b'https://www.example.com/jobs/688'","b'HTTP/1.1'","b'""Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:15.0) Gecko/20100101 Firefox/15.0.1""'","b'DHE-RSA-AES128-SHA'","b'TLSv1.2'"
"b'2015-01-01T08:00:01.206255Z'","b'elb_demo_008'","b'240.120.203.212'","b'26378'","b'172.37.170.107'","b'8888'","b'0.001174'","b'4.97E-4'","b'4.89E-4'","b'200'","b'200'","b'0'","b'2075'","b'GET'","b'http://www.example.com/articles/290'","b'HTTP/1.1'","b'""Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.135 Safari/537.36 Edge/12.246""'","b'-'","b'-'"
First, the argument to
--output-format
does not seem to be validated:--output-format foo
will still work and give the default format. Second, it seems the argument is case-sensitive;CSV
works butcsv
silently gives the default. It would be nice if I could use lower case.Third, it seems there may be some byte vs. string / encoding issues, as many strings come out as the Python repr for binary data (
b'...'
).Here is the Athena ELB log example database:
athena --execute "SELECT * FROM "sampledb"."elb_logs" limit 3;"
athena --execute "SELECT * FROM "sampledb"."elb_logs" limit 3;" --output-format CSV
It's not clear what
--output-format CSV_HEADER
supposed to do, but it's adding a duplicate header:--output-format TSV_HEADER
is also odd:The text was updated successfully, but these errors were encountered: