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
buildscript { | |
ext { | |
junitVersion = '5.3.2' | |
cassandraUnit = '2.1.9.2' | |
} | |
} | |
plugins { | |
id 'org.springframework.boot' version '2.1.5.RELEASE' | |
id 'java' |
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
package net.gueka.user.configuration; | |
import org.springframework.beans.factory.annotation.Value; | |
import org.springframework.context.annotation.Bean; | |
import org.springframework.context.annotation.Configuration; | |
import org.springframework.data.cassandra.config.AbstractCassandraConfiguration; | |
import org.springframework.data.cassandra.config.CassandraClusterFactoryBean; | |
import org.springframework.data.cassandra.core.mapping.CassandraMappingContext; | |
import org.springframework.data.cassandra.core.mapping.SimpleUserTypeResolver; | |
import org.springframework.data.cassandra.repository.config.EnableCassandraRepositories; |
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
USE tutorial; | |
CREATE TYPE location (city TEXT, zip_code TEXT, address TEXT); | |
CREATE TABLE users (id UUID PRIMARY KEY, name TEXT, surname TEXT, creation_timestamp TIMESTAMP, tags list<TEXT>, location LOCATION); |
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 tutorial WITH REPLICATION = { 'class' : 'SimpleStrategy', 'replication_factor' : 1 }; |
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
docker exec -it my-cassandra bin/cqlsh |
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
docker run -e DS_LICENSE=accept --memory 3g -p 9042:9042 --name my-cassandra -d datastax/dse-server -g -s -k |
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
import xlrd | |
from tkinter import filedialog | |
from tkinter import Tk | |
import os | |
Tk().withdraw() # we don't want a full GUI, so keep the root window from appearing | |
print("Start .xlsx parser") | |
path = filedialog.askopenfilename(initialdir = os.getcwd(),title = "Select an spreedsheet to parse ",filetypes = (("Excel files","*.xlsx"),("all files","*.*"))) # show an "Open" dialog box and return the path to the selected file | |
print("Opening file: " + path) |
NewerOlder