Created
May 3, 2021 03:58
-
-
Save nguyenthang98/5088af50e754df2b5eb4711380b4f702 to your computer and use it in GitHub Desktop.
cassandra
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
#!/bin/sh | |
# dump schema | |
cqlsh -u cassandra -p cassandra -e 'DESC KEYSPACE lwadb' >/scripts/schema_lwadb.cql | |
# dump data | |
cqlsh -k lwadb -u cassandra -p cassandra -e "COPY users to '/scripts/data_users.csv' with header=true" | |
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
#!/bin/sh | |
# import schema | |
cqlsh -u cassandra -p cassandra -e "SOURCE '/scripts/schema_lwadb.cql'" | |
# dump data | |
cqlsh -k lwadb -u cassandra -p cassandra -e "COPY users from '/scripts/data_users.csv' with header=true" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment