Forum: Managing VoltDB

Post: Loading data via csvloader

Loading data via csvloader
faisal_hussain@intuit.com
Feb 19, 2013
getting follwoing error when I am trying to load data using csvloader

csvloader HELLOWORLD -f t.txt --user testuser --password testpass

ERROR: User does not have permission to invoke HELLOWORLD.insert
Inserted 1 and acknowledged 0 rows (final)
CSVLoader elapsed: 0.324 seconds
ERROR: Invalid input on line 1.
Contents:"hello","test","test"
invalid row file is generated to:/opt/voltdb/voltdb-ent-3.0/t/csvloader_HELLOWORLD_insert_invalidrows.csv
log file is generated to:/opt/voltdb/voltdb-ent-3.0/t/csvloader_HELLOWORLD_insert_log.log
report file is generated to:/opt/voltdb/voltdb-ent-3.0/t/csvloader_HELLOWORLD_insert_report.log

testuser has both sysproc and adhoc permission , also testuser can insert rows using Voltdb Studio ... any idea ......
bballard
Feb 21, 2013
The testuser account used by csvloader needs to belong to a role that has the "defaultproc" permission in order to call the auto-generated stored procedures such as HELLOWORLD.insert. The same user is able to insert using VoltDB Studio using ad hoc SQL, but would run into the same error if calling "exec HELLOWORLD.insert ...".
faisal_hussain@intuit.com
Feb 22, 2013
ok, so now csvloader working, will follwoing work
csvloader table1 -f testfile.txt -- user testuser --password testpass
where
Table defination :table1 (id integer ,lastupdatedate timestamp)
csv file = testfile.txt and its content is (1,''2010-03-08 14:59:30.252")

Also follwoing will work on VoltDB studio ?
insert into table1 values (1,''2010-03-08 14:59:30.252");
bballard
Feb 22, 2013
Yes, that should work. When providing a TIMESTAMP datatype value as a String for input, the format should be:

yyyy-mm-dd hh:mm:ss[.f...]

The fractional seconds can be omitted. This is based on the java.sql.Timestamp.valueOf(String) method, which is used to parse the string.
bballard
Feb 22, 2013
Yes, that should work. When providing a TIMESTAMP datatype value as a String for input, the format should be:

yyyy-mm-dd hh:mm:ss[.f...]

The fractional seconds can be omitted. This is based on the java.sql.Timestamp.valueOf(String) method, which is used to parse the string.