- I write this query for migrate MySQL table. But it is not working.
- I see “time()” function of document. But migration example was not there.
sql.from(
driverName: "mysql",
dataSourceName: "${MYSQL_ACCOUNT}@tcp(mysql)",
query: "SELECT id, UNIX_TIMESTAMP(created_at) as created_at, gender, birth_year, bank_code FROM tbl_user limit 100"
)
|> rename(columns: {id: "user_id"})
|> rename(columns: {created_at: "user_created_at"})
|> rename(columns: {gender: "user_gender"})
|> rename(columns: {birth_year: "user_birth_year"})
|> rename(columns: {bank_code: "user_bank_code"})
|> duplicate(column: "user_created_at", as: "_time")
|> set(key: "_measurement", value: "tbl_user")
|> to(org: "cnf",bucket: "push_user_filter")
- Error message is here.
runtime error @18:6-21:4: to: column _time of type string is not of type time
I want to convert “user_created_at” to “_time” But it is very hard. Please save my life. help me!!!