Closed eugen-korentsov closed 7 months ago
Thanks for trying tidb2dw, but recently I may do not have time to fix those issues, sorry about that......
Also, if you open a PR to fix, I will review and merge it ASAP.
Maybe we could simply fix the issue by adding identifier escapes.
@wd0517
still issue with
googleapi: Error 400: Could not cast literal \"CURRENT_TIMESTAMP\" to type DATETIME at [16:34], invalidQuery"] [errorVerbose="googleapi: Error 400: Could not cast literal \"CURRENT_TIMESTAMP\" to type DATETIME
Schema:
CREATE TABLE `requests` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`assignee_user_id` int(11) unsigned NOT NULL,
`reporter_user_id` int(11) unsigned NOT NULL,
`priority` tinyint(3) unsigned NOT NULL DEFAULT '1' COMMENT '1 - low, 2 - mid, 3 - high',
`customer_id` varchar(255) NOT NULL,
`source_id` int(10) unsigned DEFAULT NULL,
`solution_id` int(11) unsigned NOT NULL,
`status` tinyint(3) unsigned NOT NULL DEFAULT '1' COMMENT '1 - open, 2 - in progress, 3 - done',
`label_id` int(11) unsigned NOT NULL,
`title` text DEFAULT NULL,
`description` text DEFAULT NULL,
`estimate` int(10) unsigned DEFAULT NULL,
`created_at` datetime DEFAULT NULL,
`updated_at` datetime DEFAULT NULL,
`reported_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
`se_link` varchar(255) DEFAULT NULL,
`job_id` bigint(20) unsigned DEFAULT NULL,
PRIMARY KEY (`id`) /*T![clustered_index] CLUSTERED */
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin AUTO_INCREMENT=31964
@Lloyd-Pottiger @wd0517 is it possible to fix this issue with CURRENT_TIMESTAMP ?
Hello everyone! @breezewish @Lloyd-Pottiger I need your assistance here.
We faced with the same issue during an attempt to sync another one table. Error is the same as @eugen-korentsov described previously here. Could you please fix the issue on your side to proceed with table sync using CURRENT_TIMESTAMP?
I will try to fix this issue this week
I think we should consider skipping the sync of the default function between TiDB and BigQuery. They have quite different behaviors when handle the default function, essentially BigQuery is more strict, as shown below:
rand()
function can only set to float64
column, but TiDB allows set to all the number type, like int
, float
, double
, decimal
...current_timestamp
function can only be used with timestamp
columns. For datetime
, you need to use current_datetime
instead. However, in TiDB, you can use current_timestamp
for both types.tidb2dw as a data changes replication tools from TiDB to data warehouse, user should not manual insert new data to warehouse. Therefore, it is safe to skip the default function.
This PR let tidb2dw skip sync column's default value/function, this issue can now be closed.
@eugen-korentsov @KarynaZubko
I think it is fixed by https://github.com/pingcap-inc/tidb2dw/pull/95, thanks @wd0517. current_timestamp
will be ignored in create table
statement, and will report an error in add column
statement.
Similar errors: