如何解决Cassandra 驱动程序 Nodejs:类型错误:无法读取 null 的属性“查询”
我正在编写一个 NodeJS(打字稿)应用程序,它从数据集 (https://github.com/GoogleCloudPlatform/covid-19-open-data) 中获取数据并将其推送到 cassandra 数据库中。我正在为我创建的用于存储数据的表使用 Datastax 驱动程序和映射。当我运行脚本时,一些写入失败:
TypeError: Cannot read property 'queries' of null
at InsertModelBatchItem.getQueries (node_modules/cassandra-driver/lib/mapping/model-batch-item.js:47:19)
at InsertModelBatchItem.pushQueries (/node_modules/cassandra-driver/lib/mapping/model-batch-item.js:85:17)
at /node_modules/cassandra-driver/lib/mapping/mapper.js:155:23
at Array.map (<anonymous>)
at Mapper.batch node_modules/cassandra-driver/lib/mapping/mapper.js:149:10)
我怀疑存在某种并发问题,但该错误不是很有帮助。你能帮我弄清楚这里发生了什么吗? 提前致谢。
更新:
问题是批次中的项目不同(即某些字段不存在),这触发了错误。修复是为批次中的每个项目设置正确的列。
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。