{"action":"closed","issue":{"url":"https://api.github.com/repos/openlink/virtuoso-opensource/issues/647","repository_url":"https://api.github.com/repos/openlink/virtuoso-opensource","labels_url":"https://api.github.com/repos/openlink/virtuoso-opensource/issues/647/labels{/name}","comments_url":"https://api.github.com/repos/openlink/virtuoso-opensource/issues/647/comments","events_url":"https://api.github.com/repos/openlink/virtuoso-opensource/issues/647/events","html_url":"https://github.com/openlink/virtuoso-opensource/issues/647","id":224193704,"number":647,"title":"Sql Workbench/J csv file import in Virtuoso fails on empty numeric fields","user":{"login":"beppem","id":26257378,"avatar_url":"https://avatars0.githubusercontent.com/u/26257378?v=3","gravatar_id":"","url":"https://api.github.com/users/beppem","html_url":"https://github.com/beppem","followers_url":"https://api.github.com/users/beppem/followers","following_url":"https://api.github.com/users/beppem/following{/other_user}","gists_url":"https://api.github.com/users/beppem/gists{/gist_id}","starred_url":"https://api.github.com/users/beppem/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/beppem/subscriptions","organizations_url":"https://api.github.com/users/beppem/orgs","repos_url":"https://api.github.com/users/beppem/repos","events_url":"https://api.github.com/users/beppem/events{/privacy}","received_events_url":"https://api.github.com/users/beppem/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2017-04-25T16:14:54Z","updated_at":"2017-04-27T17:23:33Z","closed_at":"2017-04-27T17:23:33Z","body":"Using Sql Workbench/J and the Virtuoso JDBC driver I want to load a csv file into a Virtuoso table. I get a `NullPointerException` when in the file a numeric field is empty. \r\nThe target table has a nullable column for the empty fields. The error is the following.\r\n\r\n    java.lang.NullPointerException\r\n    java.lang.NullPointerException\r\n            at virtuoso.jdbc4.VirtuosoPreparedStatement.setObject(VirtuosoPreparedStatement.java:846)\r\n            at virtuoso.jdbc4.VirtuosoPreparedStatement.setObject(VirtuosoPreparedStatement.java:789)\r\n            at virtuoso.jdbc4.VirtuosoPreparedStatement.setObject(VirtuosoPreparedStatement.java:773)\r\n            at workbench.db.compare.BatchedStatement.setObject(BatchedStatement.java:120)\r\n            at workbench.db.importer.DataImporter.processRowData(DataImporter.java:1368)\r\n            at workbench.db.importer.DataImporter.insertRow(DataImporter.java:1297)\r\n            at workbench.db.importer.DataImporter.processRow(DataImporter.java:1054)\r\n            at workbench.db.importer.TextFileParser.processOneFile(TextFileParser.java:743)\r\n            at workbench.db.importer.AbstractImportFileParser.start(AbstractImportFileParser.java:390)\r\n            at workbench.db.importer.DataImporter.startImport(DataImporter.java:761)\r\n            at workbench.sql.wbcommands.WbImport.execute(WbImport.java:827)\r\n            at workbench.sql.StatementRunner.runStatement(StatementRunner.java:582)\r\n            at workbench.sql.BatchRunner.executeScript(BatchRunner.java:877)\r\n            at workbench.sql.BatchRunner.executeScript(BatchRunner.java:784)\r\n            at workbench.sql.BatchRunner.runFiles(BatchRunner.java:642)\r\n            at workbench.sql.BatchRunner.execute(BatchRunner.java:596)\r\n            at workbench.WbManager.runBatch(WbManager.java:1075)\r\n            at workbench.WbManager.startApplication(WbManager.java:929)\r\n            at workbench.WbManager.main(WbManager.java:1227)\r\n            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\r\n            at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)\r\n            at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)\r\n            at java.lang.reflect.Method.invoke(Unknown Source)\r\n            at workbench.WbStarter.main(WbStarter.java:143)\r\n    Importing file 'C:\\dev\\csvFiles\\CLASSIFICATION_CODE.csv' into table CLASSIFICATION_CODE\r\n    The file \"C:\\dev\\csvFiles\\CLASSIFICATION_CODE.csv\" was not imported\r\n\r\nMy table has the following structure.\r\n\r\n    CREATE TABLE CLASSIFICATION_CODE \r\n    (\r\n      CLASSIFICATION_CODE_ID NUMERIC NOT NULL ,\r\n      CLASSIFICATION_CATEGORY VARCHAR(1) NOT NULL ,\r\n      CLASSIFICATION_PRIORITY NUMERIC \r\n      CONSTRAINT PK_CLASS_CODE PRIMARY KEY (CLASSIFICATION_CODE_ID)   \r\n    );\r\n\r\nThe file `CLASSIFICATION_CODE.csv`I am trying to upload has the following content (the last field is empty).\r\n\r\n    CLASSIFICATION_CODE_ID,CLASSIFICATION_CATEGORY,CLASSIFICATION_PRIORITY\r\n    1,^3^,\r\n    2,^2^,\r\n    3,^2^,\r\n    4,^2^,\r\n    5,^2^,\r\n    6,^3^,\r\n\r\nFinally this is the Sql Workbench/J`WbImport` command I use to import the file.\r\n\r\n    WbImport -type=text\r\n    -file='C:\\dev\\csvFiles\\CLASSIFICATION_CODE.csv'\r\n    -delimiter=,\r\n    -table=DB.PEST.CLASSIFICATION_CODE\r\n    -quoteChar=^\r\n    -encoding=UTF-8\r\n    -badfile='C:\\dev\\csvFiles\\rejected'\r\n    -continueOnError=true\r\n    -multiLine=true\r\n    -emptyStringIsNull=false;\r\n\r\nI do not see any parameter to tell to Sql Workbench/J that the field for the column `CLASSIFICATION_PRIORITY`can be null. Unless I am missing something it might be a Virtuoso JDBC driver issue, unfortunately blocking for me.\r\n\r\nI am using \r\n\r\n- Virtuoso Open Source Edition Version 7.2.4.3217-threads as of Apr 25 2016 Compiled for Win64 (x86_64-generic-win-64)\r\n- the patched Virtuoso JDBC driver `virtjdbc4_2.jar` for  jdk1.8 located to [this link](http://id.myopenlink.net/DAV/home/smalinin/Public/JDBC/)."}}
{"actor":{"display_login":"smalinin"}}