로컬 컴퓨터에서 일부 범위 쿼리를 수행하기 위해 데이터 (52GB)를 준비 중입니다.Cassandra가 예상대로 데이터를 가지고 있지 않습니다.
내 데이터는 BSON 파일에 있습니다. 나는 그것을 rdd/dataFrame을 스파크로 변환하고 빠른 범위 쿼리를 위해 Cassandra라고 적는다.
내가 선택한 데이터에는 고유 한 범위 지정 방법이 없으므로 monotically_increase()
을 호출하여 고유 한 rdd 데이터 프레임에 column(idx)
을 추가하고이를 Cassandra에 씁니다.
그러나 Cassandra는 idx 값을 매우 큰 것으로 덮어 쓰고 있습니다.
train_df = train_df.withColumn("idx", monotonically_increasing_id())
try:
#"CREATE TABLE t (pk int, t int, v text, s text, PRIMARY KEY (pk, t));
create_table = "CREATE TABLE train (idx BIGINT, cid BIGINT, img BLOB, PRIMARY KEY (idx, cid));"
session.execute(create_table)
except:
print("create table train failed")
train_df.write\
.format("org.apache.spark.sql.cassandra")\
.mode('append') \
.option("table", "train") \
.option("keyspace", "komal")\
.save()
Any query indexing above 5000 is returing empty list
query = "select * from train where idx > 5000 and idx <= 6000 ALLOW FILTERING;"
result = session.execute(query, timeout=50000000)
result.current_rows
[]
은 고유 수 카산드라의 열을 추가하는 방법에 대한 몇 가지 중 하나 도움 그래서 나는 범위 쿼리를 실행할 수 있습니까?