Skip to content

Commit 2f6d160

Browse files
authored
Adding an example table schema to showcase mapping (#99)
Co-authored-by: Madhavan Sridharan <[email protected]>
1 parent 4d706b2 commit 2f6d160

File tree

2 files changed

+24
-2
lines changed

2 files changed

+24
-2
lines changed

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
<properties>
1010
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
11-
<revision>3.2.2</revision>
11+
<revision>3.2.3</revision>
1212
<scala.version>2.12.17</scala.version>
1313
<scala.main.version>2.12</scala.main.version>
1414
<spark.version>3.3.1</spark.version>

src/resources/sparkConf.properties

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,10 +68,32 @@ spark.query.types 9,1,4,3
6868

6969
# The tool adds TTL & Writetime at row-level (not field-level).
7070
# The largest TTL & Writetime values are used if multiple indexes are listed (comma separated)
71-
# Comma separated column indexes from "spark.query.origin" used to find largest TTL or Writetime
71+
# Comma separated column indexes from "spark.query.origin" used to find largest TTL or Writetime. This is zero-based index which starts at 0
72+
# Primary keys (partition & clustering) will not have TTLs/writetimes. Also, we don't use collection columns here for pulling TTL/writetime.
7273
spark.query.ttl.cols 2,3
7374
spark.query.writetime.cols 2,3
7475

76+
############################### EXAMPLE MAPPING USING A DEMO TABLE ##########################################
77+
# If the origin and target clusters have a schema such as below,
78+
# CREATE TABLE cycling.cyclist_name (
79+
# pk1 uuid,
80+
# pk2 date,
81+
# cc1 boolean,
82+
# firstname text,
83+
# lastname text,
84+
# phones list<text>,
85+
# PRIMARY KEY((pk1,pk2),cc1)
86+
# );
87+
#
88+
# then, our mapping would look like below,
89+
# spark.query.origin pk1,pk2,cc1,firstname,lastname,phones
90+
# spark.query.origin.partitionKey pk1,pk2
91+
# spark.query.target.id pk1,pk2,cc1
92+
# spark.query.types 9,15,10,0,0,6%0
93+
# spark.query.ttl.cols 3,4
94+
# spark.query.writetime.cols 3,4
95+
#############################################################################################################
96+
7597
# ENABLE ONLY IF YOU WANT TO MIGRATE/VALIDATE ROWS BASED ON CQL FILTER
7698
#spark.query.condition
7799

0 commit comments

Comments
 (0)