FAOCropsLivestock.csv contains over 14 million lines. In my .fs file .fs I declared
type FAO = CsvProvider<"c:\FAOCropsLivestock.csv">
and tried to work with subsequent code
FAO.GetSample().Rows.Where(fun x -> x.Country = country) |> .... FAO.GetSample().Filter(fun x -> x.Country = country) |> ....
In both cases, exception was thrown.
I also tried with the following code after uploading the csv file to MSSQL Server
type Schema = SqlDataConnection<conStr> let db = Schema.GetDataContext() db.FAOCropsLivestock.Where(fun x-> x.Country = country) |> ....
it works. It also works if I issue a query using an OleDb , but it is slow.
How can I get a script from it using CsvProvider ?
f # f # -data
Emon haque
source share