Created
March 11, 2020 13:45
-
-
Save mpenick/cc58cc4134cfd93518347811100ee1ff to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE KEYSPACE IF NOT EXISTS test WITH replication = {'class': 'NetworkTopologyStrategy', 'dc1': '1'}; | |
CREATE TYPE IF NOT EXISTS test.mytype(a int, b text); | |
CREATE TABLE IF NOT EXISTS test.table_nulls (key text, s set<int>, m map<text, int>, l list<text>, t tuple<int, text>, u mytype, PRIMARY KEY(key)); | |
// set | |
INSERT INTO test.table_nulls (key, s) VALUES ('set_null', {null}) ; | |
// list | |
INSERT INTO test.table_nulls (key, l) VALUES ('list_null', {null}) ; | |
// map | |
INSERT INTO test.table_nulls (key, m) VALUES ('map_key_null', {null: 1}) ; | |
INSERT INTO test.table_nulls (key, m) VALUES ('map_value_null', {'a': null}) ; | |
// tuple | |
INSERT INTO test.table_nulls (key, t) VALUES ('tuple_null', (null, null)) ; | |
// udt | |
INSERT INTO test.table_nulls (key, u) VALUES ('udt_null', {a: null, b: null} ) ; | |
INSERT INTO test.table_nulls (key, u) VALUES ('udt_null_only_one_field', {a: 1, b: null} ) ; | |
SELECT * from test.table_nulls; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment