'How to insert map of maps data in cassandra unit?
I'm trying to insert some dummy data in cassandra unit table which has a new map of maps field frozen<map<timestamp, frozen<map<text, double>>>>. The problem is the data load query I have works on actual Cassandra DB but throws following error on Cassandra unit cluster created during unit tests execution.
com.datastax.driver.core.exceptions.InvalidQueryException: Invalid user type literal for cass_unit_test_table of type frozen<map<timestamp, frozen<map<text, double>>>>
Table Structure
CREATE TABLE cass_unit_test_table (
id double,
receivingsum double,
qtyOne frozen<map<text, double>>,
qtyTwo frozen<map<timestamp, frozen<map<text, double>>>>,
PRIMARY KEY ((id),sum)
)
Insert query if inserting directly into DB
insert
into
cass_unit_test_table(
id,
receivingsum,
qtyOne,
qtyTwo
)
values(
0,
0,
{'promo': 4,'order': 5, 'xyz': 6 },
{1648166400000:{'foo':0.0,'bar':0.0 }}
);
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
