Skip to content

Commit 1801ec1

Browse files
msmygitpravinbhat
andauthored
Replace dateOf function with toTimestamp as it is fully removed in C* 5.0.3 (#351)
* dateOf function is fully removed in C* 5.0.3 * Added release notes --------- Co-authored-by: Pravin Bhat <[email protected]>
1 parent 6e1b30d commit 1801ec1

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

RELEASE.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# Release Notes
22

3+
## [5.2.2] - 2025-04-02
4+
- Replaced deprecated (not supported in Cassandra 5.0.3+) function `dateof()` with `totimestamp()`
5+
36
## [5.2.1] - 2025-03-10
47
- Implemented [`column.skip`](https://github.com/datastax/cassandra-data-migrator/blob/main/src/resources/cdm-detailed.properties#L97) feature
58

src/main/java/com/datastax/cdm/cql/statement/TargetUpsertRunDetailsStatement.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,15 +76,15 @@ public TargetUpsertRunDetailsStatement(CqlSession session, String keyspaceTable)
7676
}
7777

7878
boundInitInfoStatement = bindStatement("INSERT INTO " + cdmKsTabInfo
79-
+ " (table_name, run_id, run_type, prev_run_id, start_time, status) VALUES (?, ?, ?, ?, dateof(now()), ?)");
79+
+ " (table_name, run_id, run_type, prev_run_id, start_time, status) VALUES (?, ?, ?, ?, totimestamp(now()), ?)");
8080
boundInitStatement = bindStatement("INSERT INTO " + cdmKsTabDetails
8181
+ " (table_name, run_id, token_min, token_max, status) VALUES (?, ?, ?, ?, ?)");
8282
boundEndInfoStatement = bindStatement("UPDATE " + cdmKsTabInfo
83-
+ " SET end_time = dateof(now()), run_info = ?, status = ? WHERE table_name = ? AND run_id = ?");
83+
+ " SET end_time = totimestamp(now()), run_info = ?, status = ? WHERE table_name = ? AND run_id = ?");
8484
boundUpdateStatement = bindStatement("UPDATE " + cdmKsTabDetails
8585
+ " SET status = ?, run_info = ? WHERE table_name = ? AND run_id = ? AND token_min = ?");
8686
boundUpdateStartStatement = bindStatement("UPDATE " + cdmKsTabDetails
87-
+ " SET start_time = dateof(now()), status = ? WHERE table_name = ? AND run_id = ? AND token_min = ?");
87+
+ " SET start_time = totimestamp(now()), status = ? WHERE table_name = ? AND run_id = ? AND token_min = ?");
8888
boundSelectInfoStatement = bindStatement(
8989
"SELECT status FROM " + cdmKsTabInfo + " WHERE table_name = ? AND run_id = ?");
9090
boundSelectStatement = bindStatement("SELECT token_min, token_max FROM " + cdmKsTabDetails

0 commit comments

Comments
 (0)