Skip to content

Commit e47cd01

Browse files
committed
added config for 10MB value
1 parent 05d24f1 commit e47cd01

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/main/java/datastax/astra/migrate/OriginCountJobSession.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ protected OriginCountJobSession(CqlSession sourceSession, SparkConf sparkConf) {
5858
filterColName = sparkConf.get("spark.origin.FilterColumn");
5959
filterColType = sparkConf.get("spark.origin.FilterColumnType");
6060
filterColIndex = Integer.parseInt(sparkConf.get("spark.origin.FilterColumnIndex", "0"));
61-
fieldGuardraillimitMB = Integer.parseInt(sparkConf.get("spark.fieldGuardraillimitMB", "0"));
61+
fieldGuardraillimitMB = Integer.parseInt(sparkConf.get("spark.fieldGuardraillimitMB", "0"));
6262

6363
String partionKey = sparkConf.get("spark.query.cols.partitionKey");
6464
idColTypes = getTypes(sparkConf.get("spark.query.cols.id.types"));
@@ -94,7 +94,7 @@ public void getData(BigInteger min, BigInteger max) {
9494
if(checkTableforColSize) {
9595
int rowColcnt = GetRowColumnLength(sourceRow, filterColType, filterColIndex);
9696
String result = "";
97-
if (rowColcnt > fieldGuardraillimitMB) {
97+
if (rowColcnt > fieldGuardraillimitMB * 1048576) {
9898
for (int index = 0; index < checkTableforColSizeTypes.size(); index++) {
9999
MigrateDataType dataType = checkTableforColSizeTypes.get(index);
100100
Object colData = getData(dataType, index, sourceRow);
@@ -116,7 +116,7 @@ public void getData(BigInteger min, BigInteger max) {
116116
if(checkTableforColSize) {
117117
int rowColcnt = GetRowColumnLength(sourceRow, filterColType, filterColIndex);
118118
String result = "";
119-
if (rowColcnt > fieldGuardraillimitMB) {
119+
if (rowColcnt > fieldGuardraillimitMB * 1048576) {
120120
for (int index = 0; index < checkTableforColSizeTypes.size(); index++) {
121121
MigrateDataType dataType = checkTableforColSizeTypes.get(index);
122122
Object colData = getData(dataType, index, sourceRow);

src/resources/sparkConf.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ spark.splitSize 10000
2828
spark.batchSize 5
2929
spark.coveragePercent 100
3030
spark.printStatsAfter 100000
31-
spark.fieldGuardraillimitMB 10485760
31+
spark.fieldGuardraillimitMB 10
3232

3333
spark.query.origin partition-key,clustering-key,order-date,amount
3434
spark.query.origin.partitionKey partition-key

0 commit comments

Comments
 (0)