netezza external table gunzip unexpected end of file errpr


We are loading data from Netezza into a Netezza external table (file on unix).

The .txt file is compressed into a .gz file using gzip, then ftp'd to a windows 2008 server &  decompressed using gunzip (on the windows server).

When running a gunzip command on Windows, the command fails with an 'unexpected end of file' error:

Creating a .txt file straight from vi on unix, gzip it, then ftp'ng to windows followed by gunzip all works great.

Thoughts on what could be added to the External Table definition or ?

Thank you!

Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Can you successfully gunzip the file before FTP'ing it to the windows box? Are you using binary mode in FTP?

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
ssebringAuthor Commented:
Hi, thank you for your reply.

yes - it was a binary file send, realized this just after posting question.  Now working on a solution but having issues.

Executing gunzip on windows 2008 server with:

gunzip.exe –c -f -N -q -a --ascii filename.txt.gz

partially decompresses then fails with:

gunzip: invalid compressed data—format violated

note: have played with compressing (gzip) the file with and without the ascii parms (also different files), played with parms on gunzip w/out success (yet).

ssebringAuthor Commented:
ok, everything is now working.  Accepting the comment by jlevie.

In addition to gettimg the gzip/gunzip parms correct, the ftp script task needed to have a change:

ftp.ReceiveFiles(files, localDir, True, False)

the last arg sets isTransferAscii to False (previously was set to True).

gzip args:  -c -N -q -f
gunzip args: -d -q -f -N -a
ssebringAuthor Commented:
posted last comment regarding final solution
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.