{"action":"opened","issue":{"url":"https://api.github.com/repos/jut-io/node-cassandra-native-driver/issues/40","labels_url":"https://api.github.com/repos/jut-io/node-cassandra-native-driver/issues/40/labels{/name}","comments_url":"https://api.github.com/repos/jut-io/node-cassandra-native-driver/issues/40/comments","events_url":"https://api.github.com/repos/jut-io/node-cassandra-native-driver/issues/40/events","html_url":"https://github.com/jut-io/node-cassandra-native-driver/issues/40","id":106388303,"number":40,"title":"null column values trigger an error","user":{"login":"simong","id":92180,"avatar_url":"https://avatars.githubusercontent.com/u/92180?v=3","gravatar_id":"","url":"https://api.github.com/users/simong","html_url":"https://github.com/simong","followers_url":"https://api.github.com/users/simong/followers","following_url":"https://api.github.com/users/simong/following{/other_user}","gists_url":"https://api.github.com/users/simong/gists{/gist_id}","starred_url":"https://api.github.com/users/simong/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/simong/subscriptions","organizations_url":"https://api.github.com/users/simong/orgs","repos_url":"https://api.github.com/users/simong/repos","events_url":"https://api.github.com/users/simong/events{/privacy}","received_events_url":"https://api.github.com/users/simong/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-09-14T17:14:40Z","updated_at":"2015-09-14T17:14:40Z","closed_at":null,"body":"When a row contains a column that is unset or `null` the following error is thrown:\r\n```\r\nunable to obtain column value\r\n```\r\n\r\nI poked around a bit in [result.cc](https://github.com/jut-io/node-cassandra-native-driver/blob/master/src/result.cc#L66) and as far as I can work out it seems that the value of a column is used to determine the mapping. Can a rule be added to map null column values to `null` in node land?\r\n\r\nHere's a test case that fails on current master\r\n```\r\nvar TestClient = require('./test-client');\r\nvar Promise = require('bluebird');\r\nvar expect = require('chai').expect;\r\nvar _ = require('underscore');\r\nvar util = require('util');\r\nvar test_utils = require('./test-utils');\r\n\r\ndescribe('columns with null values', function() {\r\n\r\n    var ks = 'paging_test';\r\n    var table = 'test';\r\n    var fields = {\r\n        'row': 'varchar',\r\n        'col': 'int',\r\n        'val': 'int'\r\n    };\r\n\r\n    var key = 'row, col';\r\n    var data = [{\r\n        'row': 'row-1',\r\n        'col': 1\r\n        // Do NOT pass in the val column so it ends up as a null column in Cassandra\r\n    }];\r\n    var client;\r\n\r\n    before(function() {\r\n        client = new TestClient();\r\n        return test_utils.setup_environment(client)\r\n            .then(function() {\r\n                return client.createTable(table, fields, key);\r\n            })\r\n            .then(function() {\r\n                return client.insertRows(table, data);\r\n            });\r\n    });\r\n\r\n    it('retrieves null columns', function() {\r\n        var cql = util.format('SELECT * FROM %s where ROW = ?', table);\r\n        return client.prepare(cql)\r\n            .then(function(prepared) {\r\n                var q = prepared.query();\r\n                q.bind(['row-1'], {});\r\n                Promise.promisifyAll(q);\r\n                return q.executeAsync({});\r\n            })\r\n            .then(function(results) {\r\n                expect(results.rows.length).equal(1);\r\n                var row = results.rows[0];\r\n                var keys = Object.keys(row);\r\n                expect(keys.length).equal(3);\r\n                expect(row.row).equal('row-1');\r\n                expect(row.col).equal(1);\r\n                expect(row.val).equal(null);\r\n            });\r\n    });\r\n\r\n    after(function() {\r\n        return client.cleanup();\r\n    });\r\n});\r\n```"}}