hannes / MonetDBLite

MonetDB reconfigured as a library
108 stars 11 forks source link

new 'ParseException:SQLparser:'. error with brfss #165

Closed ajdamico closed 7 years ago

ajdamico commented 7 years ago

hi, i believe the unix/windows brfss crashes on sisyphus are the result of today's jul2017lite-r merge. if it is not obvious to you how to fix it, please assign this task to me and i will try to narrow to a minimal reproducible example -- but it might take me two weeks? thanks homie

hannes commented 7 years ago

no rush

ajdamico commented 7 years ago

looks related to https://github.com/hannesmuehleisen/MonetDBLite/issues/164

library(lodown)
library(DBI)

tf <- tempfile()
csvfile <- tempfile()

dbdir <- file.path( tempdir() , "dbdir" )

db <- dbConnect( MonetDBLite::MonetDBLite() , dbdir )

cachaca( 'ftp://ftp.cdc.gov/pub/data/Brfss/CDBRFS91XPT.zip' , tf, mode = 'wb' )

unzipped_files <- unzip( tf )

x <- foreign::read.xport(unzipped_files)
names(x) <- tolower(names(x))
names(x)[names(x) == "level"] <- "level_"
write.csv(x, csvfile, row.names = FALSE)
rtctr <- nrow(x)

# correctly fails
dbWriteTable(db, 'tablename', csvfile, na.strings = "NA", nrow.check = rtctr, lower.case.names = TRUE)

# immediately afterwards

# this SHOULD work
dbSendQuery(db, "CREATE TABLE tablename (colname DOUBLE PRECISION)" )
# Error in .local(conn, statement, ...) : 
  # Unable to execute statement 'CREATE TABLE tablename (colname DOUBLE PRECISION)'.
# Server says 'ParseException:SQLparser:'.
hannes commented 7 years ago

yes i think thats a duplicate of https://github.com/hannesmuehleisen/MonetDBLite/issues/164

ajdamico commented 7 years ago

once you fix #164, please just copy and paste my code into a console to verify this is fixed as well? thanks

hannes commented 7 years ago

this works now :)