Skip to content

Commit

Permalink
Fixed cast for version 1 timestamp export.
Browse files Browse the repository at this point in the history
  • Loading branch information
dreibh committed Dec 2, 2024
1 parent 82f965f commit 84b4048
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/hpct-query.cc
Original file line number Diff line number Diff line change
Expand Up @@ -531,10 +531,10 @@ int main(int argc, char** argv)
if(tableVersion == 1) {
std::string ts;
if( (backend & DatabaseBackendType::SQL_PostgreSQL) == DatabaseBackendType::SQL_PostgreSQL ) {
ts = "(1000000000 * CAST(EXTRACT(EPOCH FROM TimeStamp) AS BIGINT))";
ts = "CAST((1000000000.0 * EXTRACT(EPOCH FROM TimeStamp)) AS BIGINT)";
}
else {
ts = "(1000000000 * CAST(UNIX_TIMESTAMP(TimeStamp) AS UNSIGNED))";
ts = "CAST((1000000000.0 * UNIX_TIMESTAMP(TimeStamp)) AS UNSIGNED)";
}
statement
<< "SELECT"
Expand Down Expand Up @@ -685,10 +685,10 @@ int main(int argc, char** argv)
if(tableVersion == 1) {
std::string ts;
if( (backend & DatabaseBackendType::SQL_PostgreSQL) == DatabaseBackendType::SQL_PostgreSQL ) {
ts = "(1000000000 * CAST(EXTRACT(EPOCH FROM TimeStamp) AS BIGINT))";
ts = "CAST((1000000000.0 * EXTRACT(EPOCH FROM TimeStamp)) AS BIGINT)";
}
else {
ts = "(1000000000 * CAST(UNIX_TIMESTAMP(TimeStamp) AS UNSIGNED))";
ts = "CAST((1000000000.0 * UNIX_TIMESTAMP(TimeStamp)) AS UNSIGNED)";
}
statement
<< "SELECT"
Expand Down

0 comments on commit 84b4048

Please sign in to comment.