{"action":"closed","issue":{"url":"https://api.github.com/repos/dimitri/pgloader/issues/372","repository_url":"https://api.github.com/repos/dimitri/pgloader","labels_url":"https://api.github.com/repos/dimitri/pgloader/issues/372/labels{/name}","comments_url":"https://api.github.com/repos/dimitri/pgloader/issues/372/comments","events_url":"https://api.github.com/repos/dimitri/pgloader/issues/372/events","html_url":"https://github.com/dimitri/pgloader/issues/372","id":142985441,"number":372,"title":"Failure using \"null if\" option","user":{"login":"spluque","id":4427482,"avatar_url":"https://avatars.githubusercontent.com/u/4427482?v=3","gravatar_id":"","url":"https://api.github.com/users/spluque","html_url":"https://github.com/spluque","followers_url":"https://api.github.com/users/spluque/followers","following_url":"https://api.github.com/users/spluque/following{/other_user}","gists_url":"https://api.github.com/users/spluque/gists{/gist_id}","starred_url":"https://api.github.com/users/spluque/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/spluque/subscriptions","organizations_url":"https://api.github.com/users/spluque/orgs","repos_url":"https://api.github.com/users/spluque/repos","events_url":"https://api.github.com/users/spluque/events{/privacy}","received_events_url":"https://api.github.com/users/spluque/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-03-23T15:04:22Z","updated_at":"2016-03-23T16:21:13Z","closed_at":"2016-03-23T16:21:13Z","body":"Using the example provided in the csv.md example of the distribution, with version:\r\n\r\n```sh\r\n$ pgloader --version\r\npgloader version \"3.2.2\"\r\ncompiled with SBCL 1.2.4.debian\r\n```\r\n\r\nand modifying the `csv.load` command file's second line to read:\r\n\r\n`FROM 'path/to/file.csv' (x, y, a, b null if blanks, c, d)`\r\n\r\ntrying to load this fails with:\r\n\r\n```sh\r\n$ pgloader csv.load\r\nAn unhandled error condition has been signalled: At\r\n\r\n  LOAD CSV\r\n  \r\n  ^ (Line 1, Column 0, Position 0)\r\n\r\nCould not parse subexpression \"into\" when parsing\r\n\r\n Expression PGLOADER.PARSER::COMMANDS\r\n    Subexpression (+ PGLOADER.PARSER::COMMAND)\r\n    Subexpression PGLOADER.PARSER::COMMAND\r\n    Subexpression (AND\r\n                   (OR PGLOADER.PARSER::LOAD-ARCHIVE\r\n                       PGLOADER.PARSER::LOAD-CSV-FILE\r\n                       PGLOADER.PARSER::LOAD-FIXED-COLS-FILE\r\n                       PGLOADER.PARSER::LOAD-COPY-FILE\r\n                       PGLOADER.PARSER::LOAD-DBF-FILE\r\n                       PGLOADER.PARSER::LOAD-IXF-FILE\r\n                       PGLOADER.PARSER::LOAD-MYSQL-DATABASE\r\n                       PGLOADER.PARSER::LOAD-MSSQL-DATABASE\r\n                       PGLOADER.PARSER::LOAD-SQLITE-DATABASE)\r\n                   PGLOADER.PARSER::END-OF-COMMAND)\r\n    Subexpression (OR PGLOADER.PARSER::LOAD-ARCHIVE\r\n                      PGLOADER.PARSER::LOAD-CSV-FILE\r\n                      PGLOADER.PARSER::LOAD-FIXED-COLS-FILE\r\n                      PGLOADER.PARSER::LOAD-COPY-FILE\r\n                      PGLOADER.PARSER::LOAD-DBF-FILE\r\n                      PGLOADER.PARSER::LOAD-IXF-FILE\r\n                      PGLOADER.PARSER::LOAD-MYSQL-DATABASE\r\n                      PGLOADER.PARSER::LOAD-MSSQL-DATABASE\r\n                      PGLOADER.PARSER::LOAD-SQLITE-DATABASE)\r\n    Subexpression PGLOADER.PARSER::LOAD-CSV-FILE\r\n    Subexpression PGLOADER.PARSER::LOAD-CSV-FILE-COMMAND\r\n    Subexpression (AND PGLOADER.PARSER::CSV-SOURCE\r\n                       (ESRAP:? PGLOADER.PARSER::FILE-ENCODING)\r\n                       (ESRAP:? PGLOADER.PARSER::CSV-SOURCE-FIELD-LIST)\r\n                       PGLOADER.PARSER::TARGET\r\n                       (ESRAP:? PGLOADER.PARSER::CSV-TARGET-COLUMN-LIST)\r\n                       PGLOADER.PARSER::LOAD-CSV-FILE-OPTIONAL-CLAUSES)\r\n    Subexpression PGLOADER.PARSER::TARGET\r\n    Subexpression (AND PGLOADER.PARSER::KW-INTO\r\n                       (OR PGLOADER.PARSER::PGSQL-URI\r\n                           PGLOADER.PARSER::GET-PGSQL-URI-FROM-ENVIRONMENT-VARIABLE))\r\n    Subexpression PGLOADER.PARSER::KW-INTO\r\n    Subexpression (AND PGLOADER.PARSER::IGNORE-WHITESPACE (ESRAP:~ \"into\")\r\n                       PGLOADER.PARSER::IGNORE-WHITESPACE)\r\n    Subexpression \"into\"\r\n```\r\n\r\nIf I understand right, this shouldn't fail even if the input file doesn't require the \"null if blanks\" option, but I tried it with that example to test a scenario."}}