6
Przechodzę przez pyspark_cassandra.Spark + cassandra: jak stworzyć keyspace?
Ale nie widzę sposobu, aby utworzyć tabelę/keyspace => czy jest to w ogóle możliwe?
Jeśli tak, w jaki sposób?
Przechodzę przez pyspark_cassandra.Spark + cassandra: jak stworzyć keyspace?
Ale nie widzę sposobu, aby utworzyć tabelę/keyspace => czy jest to w ogóle możliwe?
Jeśli tak, w jaki sposób?
Może możesz wypróbować ten pakiet?
Ten pakiet pochodzi z DataStax, który jest sterownikiem Cassandry dla Pythona.
Github: https://github.com/datastax/python-driver
API Dokumenty: https://datastax.github.io/python-driver/api/cassandra/cluster.html
from cassandra.cluster import Cluster
cluster = Cluster(['your_cassandra_ip'])
session = cluster.connect()
session.execute('CREATE KEYSPACE IF NOT EXISTS mykeyspace WITH REPLICATION = { 'class' : 'SimpleStrategy', 'replication_factor' : 3 };')