cancel
Showing results for 
Search instead for 
Did you mean: 

String index out of range: -1 error when importing into HANA database. Please help

Former Member
0 Kudos

Hi,

I'm new to HANA and am in the process of setting up my environment on an Amazon EC2 instance.

I have a table with this schema:

create table XYZ (eventId int, node varchar (30), milliseconds bigint, A1 int, A2 int, A3 bigint, A4 varchar (50), A5 smallint, A6 varchar (50), A7 varchar (50), A8 int, A9 smallint, A10 varchar (50), A11 bigint, A12 int, A13 varchar (50), A14 smallint, A15 smallint, A16 varchar (50), A17 varchar (50), A18 int, A19 smallint, A20 smallint, A21 bigint, A22 bigint, A23 bigint, A24 smallint, A25 varchar(50), A26 smallint, A27 bigint, A28 varchar(50), A29 varchar(50), A30 varchar(50), A31 varchar(50), A32 varchar(50), A33 varchar(50), A34(50), A35 varchar(50), A36 varchar(50), A37 varchar(50), A38 varchar(50), A39 varchar(50), A40 varchar(30), A41 varchar(30), A42 varchar(30));

and when I try to populate it with by importing a single row .csv file (via Import from the Quick Launch menu, then SAP HANA Content and then Import from local file) which contains this data:

0,test,1213225560,-1,-1,326,61404560845,2,-1,-1,-

1,2,0405089470,337,31711,0405089470,4,1,359544016932580,505037908535492,-

1,1,1,325,359,325,0,1614051104F2FFFFFFFFFFFFFFFFFFFF1D9B14040A,5,330,-1,-

1,XYZ,123,XYZ,123,-1,-1,XYZ,123,-1,-1,-1,-1,-1

I get a String index out or range: -1 error.

When I check the table definition I note that the column store data type is set to string for varchars. Is this the issue? Can I change these data types?

Thanks in advance,

G

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

I copied your SQL and created a similar table in my local HANA box (not the Amazon instance) - there is a little typo in your statement around column A34 - so I changed it to A34 varchar(50) instead.

I then copied your single row into a .csv file and that loaded successfully into the above table using the import from local file option in the Studio.

Within the field mapping using the above option I selected "one to one mapping" - the automatic mapping that you can select from the "mapping menu" on the left side of the mapping screen.

I would suggest you check the following:

a. If your mappings were correct - if you manually mapped them there is a possibility that you made a mistake

b. Check if your .csv file had no unwanted spaces and that it isnt spread across multiple lines

c. I am on revision 35. Revision 35 is now available for HANA Amazon as well - You can upgrade yours to 35 if you haven't done already from here: http://scn.sap.com/community/developer-center/hana     under "Ready for the next step"

Thanks,

Anooj

Former Member
0 Kudos

Hi Anooj,

Apologies for the late reply.

Many thanks for your helpful response.

Thanks,

Gavan

Answers (0)