on 08-19-2019 9:37 PM
I'm trying to load data from a .csv, but keep getting an error (Segmentation fault: 11).
Any Solution?
Below is the terminal output and content of cds and csv.
/> successfully deployed database to ./db/test-example.db
> filling Testing from db/csv/Testing.csv
Segmentation fault: 11
test.cds
entity Testing {
key userId : String(10);
name : String(20);
}
Testing.csv
userId;name
"0000000001";"Willy the whale"
"0000000002";"Donald duck"
cds version:
@sap/cds: 3.13.0
@sap/cds-compiler: 1.15.0
@sap/cds-ql: 1.14.0
@sap/cds-hana: 1.13.0
@sap/cds-sql: 1.13.0
@sap/cds-sqlite: 1.13.0
@sap/cds-reflect: 2.5.0
@sap/cds-services: 1.14.0
@sap/odata-server: 1.3.4
@sap/odata-commons: 2.1.1
@sap/generator-cds: 2.4.11
Hi,
As Gregor mentioned, the csv files should use the following naming convention:
<namespace>-<entity>.csv so in your case Test.cds-Testing.csv
However the dot might be an issue, you should try to rename your namespace to just Test or even better, pick some meaningful names. 😉
Cheers,
Pierre
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Ok forget about my comment, I need a coffee. Test.cds is the filename, not the namespace. 🙂
I just did a quick test but I can't reproduce the issue:
PS C:\Users\pdominique\Code\cap\test> cat .\db\test.cds
entity Testing {
key userId : String(10);
name : String(20);
}
PS C:\Users\pdominique\Code\cap\test> cat .\db\csv\Testing.csv
userId;name
"0000000001";"Willy the whale"
"0000000002";"Donald duck"
PS C:\Users\pdominique\Code\cap\test> cds deploy --to sqlite:db/test.db
> filling Testing from db\csv\Testing.csv
> updated package.json
/> successfully deployed database to ./db/test.db
PS C:\Users\pdominique\Code\cap\test> cds v
@sap/cds: 3.13.0
@sap/cds-compiler: 1.15.0
@sap/cds-ql: 1.14.0
@sap/cds-hana: 1.13.0
@sap/cds-sql: 1.13.0
@sap/cds-sqlite: 1.13.0
@sap/cds-reflect: 2.5.0
@sap/cds-services: 1.14.0
@sap/odata-server: 1.3.4
@sap/odata-commons: 2.1.1
@sap/generator-cds: 2.4.11
CDS home: C:\Users\pdominique\Code\cap\test\node_modules\@sap\cds
Not a solution yet, but just to double check I have all the pieces - I am trying to reproduce the issue, but not having much success
Perhaps you could share your test project, e.g. in a Gist / on GitHub?
The one thing that strikes me as odd is that the order of the messages in the "deploy" output is the "wrong way round", i.e. "successfully deployed ..." comes last, usually.
FWIW, I've seen a segfault error before, but can't remember the circumstances.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
HI,
I have found the solution 🙂
When i created a new project, copied the files and did a build. It was worked!
Regards,
Henrik
Have you tried renaming your .csv file to test-cds-Testing.csv to match the namespace?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Gregor,
It's actually one of the mysteries and could be the answer 🙂
It seems that there is some confusion using '-', '.' or '_'. I have seen different kind of notation (ie. com.sap.sapmentors.sitregcapm-EventTypes.csv from sitregcapm) and tried different kind with no success.
Do you know the secret? Should '-' always be used and not '.' and '_'?
And what does 'Segmentation fault:11' mean?
Have you found the documentation 🙂
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
This video has nothing to do with the CDS way to import CSV.
User | Count |
---|---|
75 | |
9 | |
8 | |
7 | |
6 | |
5 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.