Need help in inserting data into MySQL using R. I am getting the following error and do not know how to fix this:
Error: C stack usage 7971984 is too close to the limit
This is not a memory allocation problem, as I have tried inserting a much smaller dataset, but still i get this error. Also whenever i run dbWriteTable() function it deletes the table i have created in MySQL DB.
The table i have created in MySQL for insertion is:
+------------+--------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+------------+--------------+------+-----+---------+-------+
| concat | varchar(26) | YES | UNI | NULL | |
| store_id | varchar(26) | NO | | NULL | |
| product_id | varchar(26) | NO | | NULL | |
| predicted | decimal(3,1) | NO | | NULL | |
+------------+--------------+------+-----+---------+-------+
The table in R for insertion is:
'data.frame': 28709 obs. of 4 variables:
$ unique : chr "204227_294" "204363_294" "92662_1471" "166876_1471" ...
$ product_id: chr "294" "294" "1471" "1471" "1495" "1504" "1508" "1508" "1508" "1508" ...
$ store_id : chr "204227" "204363" "92662" "166876" ...
$ predicted : num 0.204 0.697 0.204 0.827 0.204 ...
The code for inserting data into MySQL DB is:
mydb = dbConnect(RMySQL::MySQL(), username="XXXXXX",
password="YYYYY",
dbname='ZZZZZ',
host="XX.Y.ZZ.XXXX",
port=3306)
dbWriteTable(mydb, name="analytics.fulfillment_ratio",
value=final_combo,
field.types=list(concat="varchar(26)",
store_id="varchar(26)",
product_id="varchar(26)",
predicted="decimal(3,1)"),
row.names=FALSE,
overwrite = TRUE)
Any help will be great...thanks.