-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
mysql同步出错 #8
Comments
找到原因了,同步出错,是因为mysql 主键 id bigint(20) unsigned 没有适配到clickhouse对应数据类型
就可以了 |
修复提交了 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-- mysql表
CREATE TABLE clickhousetest(
id
bigint(20) unsigned NOT NULL AUTO_INCREMENT,verificatTaskUuid
varchar(50) NOT NULL COMMENT 'uuid',checkDuration
int(11) DEFAULT NULL,PRIMARY KEY (
id
))ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT charset=utf8mb4;
使用命令
chm --src mysql --src-host 192.168.1.2 --src-port 3306 --src-user root --src-password 12d@s --src-database test --src-table clickhousetest --drop-table true --host 192.168.1.1 --port 9000 --user default --password 22sWd --database test
出错信息:
WARN: DROP TABLE IF EXISTS test.clickhousetest;
Progress: 7 rows (1 rows/s.)ERROR: System.InvalidCastException: Unable to cast object of type 'System.UInt64' to type 'System.Int64'.
at System.Linq.Enumerable.CastIterator[TResult](IEnumerable source)+MoveNext()
at System.Collections.Generic.LargeArrayBuilder
1.AddRange(IEnumerable
1 items)at System.Collections.Generic.EnumerableHelpers.ToArray[T](IEnumerable
1 source) at System.Linq.Enumerable.ToArray[TSource](IEnumerable
1 source)at ClickHouse.Ado.Impl.ColumnTypes.SimpleColumnType`1.ValuesFromConst(IEnumerable objects)
at ClickHouse.Ado.ClickHouseCommand.Execute(Boolean readResponse, ClickHouseConnection connection)
at ClickHouse.Ado.ClickHouseCommand.ExecuteNonQuery()
at ClickHouseMigrator.Migrator.<>c__DisplayClass14_0.b__2() in C:\Users\Administrator\source\repos\ClickHouseMigrator-master\src\ClickHouseMigrator
Migrator.cs:line 166
Elapsed 5 sec. Processed 7 rows (1 rows/s.)
The text was updated successfully, but these errors were encountered: