lorint / AdventureWorks-for-Postgres

Set up the AdventureWorks sample database for use with Postgres
MIT License
369 stars 185 forks source link

Importing from CSV fails, with notification: " No such file or directory" for all files. #11

Closed otariki closed 1 year ago

otariki commented 3 years ago

As instruction says all csv files, install.sql and update_csvs.rb files in same folder. When ran "ruby update_csvs.rb" it only proceeded few files:

Processing ./BusinessEntity.csv
Processing ./JobCandidate.csv
Processing ./EmailAddress.csv
Processing ./ProductDescription.csv
Processing ./Person.csv
Processing ./BusinessEntityContact.csv
Processing ./Password.csv
Processing ./ProductModelorg.csv
Processing ./ProductPhoto.csv
Processing ./JobCandidate_TOREMOVE.csv
Processing ./PhoneNumberType.csv
Processing ./CountryRegion.csv
Processing ./StateProvince.csv
Processing ./BusinessEntityAddress.csv
Processing ./PersonPhone.csv
Processing ./Illustration.csv
Processing ./ProductModel.csv
Processing ./Document.csv
Processing ./CountryRegionCurrency.csv
Processing ./Store.csv
Processing ./Employee.csv

Then, when ran: "psql -d Adventureworks < install.sql" All 68 tables are created, but all of them are empty, checked terminal and it shows notifications like this:

 Document.csv: No such file or directory
 Copying data into Production.ProductCategory

ProductCategory.csv: No such file or directory
 Copying data into Production.ProductSubcategory
 ...

 CountryRegionCurrency.csv: No such file or directory
 Copying data into Sales.CreditCard

CreditCard.csv: No such file or directory
 Copying data into Sales.Currency
davc93 commented 2 years ago

I have the same problem

fritzer23 commented 2 years ago

Hello, are there any solution for the empty Table problem? Got the same here.

pottertr commented 1 year ago

the encoding on the .csv files are not all the same and the files that won't loaded are the ones with UTF-8. Using Notepad++ I changed the encoding to UTF-16 LE BOM and all files loaded. Don't know if ruby script needs to be updated to reflect UTF-8 in all caps or anything else, but changing the encoding worked for me

lorint commented 1 year ago

@davc93 @fritzer23 @pottertr -- while looking into this I became aware that the binary GIF files and geospatial address info wasn't coming together properly. Have made an update in this commit that either may help or hurt the situation, don't know! On my Mac the GIF data comes together properly anyway when rendering things using The Brick. 9176776a3d2053576b59a3737d59bac7c55806a3

Would be interested to hear if you find it useful, and certainly let me know if you think anything should be further revised.