You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by "laizuan (via GitHub)" <gi...@apache.org> on 2024/03/06 08:09:38 UTC

[I] [Bug] Mysql bit 类型字段生成Doris schema 错误 [doris-flink-connector]

laizuan opened a new issue, #330:
URL: https://github.com/apache/doris-flink-connector/issues/330

   ### Search before asking
   
   - [X] I had searched in the [issues](https://github.com/apache/incubator-doris/issues?q=is%3Aissue) and found no similar issues.
   
   
   ### Version
   
   flink-doris-connector-1.18-1.5.2.jar
   flink: 1.18.1
   mysql: 8.0
   doris: 2.0.5
   
   ### What's Wrong?
   
   
   数据库字段`xxx`是bit类型,并且不为空。生成Doris预计如下:
   
   ```sql
   CREATE TABLE IF NOT EXISTS `xx`.`xx`(
     `id` BIGINT COMMENT '主键',
     `xxx` BOOLEAN DEFAULT 'b' 0 '' COMMENT 'xxx'
   ) UNIQUE KEY(`id`) DISTRIBUTED BY HASH(`id`) BUCKETS AUTO PROPERTIES (
     'replication_num' = '1',
     'light_schema_change' = 'true'
   )
   ```
   在控制执行SQL后的异常:
   ```txt
   Failed to execute sql: org.apache.doris.common.AnalysisException: errCode = 2, detailMessage = Syntax error in line 3:
     `xxx` BOOLEAN DEFAULT 'b' 0 '' COMMENT 'xxx'
                                                  ^
   Encountered: INTEGER LITERAL
   Expected: COMMA
   ```
   
   ### What You Expected?
   
   
   ```sql
   CREATE TABLE IF NOT EXISTS `cm`.`xx`(
     `id` BIGINT COMMENT '主键',
     `xxx` BOOLEAN DEFAULT 'false' COMMENT 'xxx'
   ) UNIQUE KEY(`id`) DISTRIBUTED BY HASH(`id`) BUCKETS AUTO PROPERTIES (
     'replication_num' = '1',
     'light_schema_change' = 'true'
   )
   ```
   
   ### How to Reproduce?
   
   _No response_
   
   ### Anything Else?
   
   _No response_
   
   ### Are you willing to submit PR?
   
   - [ ] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


Re: [I] [Bug] Mysql bit 类型字段生成Doris schema 错误 [doris-flink-connector]

Posted by "laizuan (via GitHub)" <gi...@apache.org>.
laizuan commented on issue #330:
URL: https://github.com/apache/doris-flink-connector/issues/330#issuecomment-1993050527

   thks
   
   > The main issue is the mismatch between the default values of MySQL and Doris, resulting in DDL errors. Solutions: 1. Use Flink Connector version 1.5.1. 2. Wait for the next version to fix it.
   
   thks
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


Re: [I] [Bug] Mysql bit 类型字段生成Doris schema 错误 [doris-flink-connector]

Posted by "laizuan (via GitHub)" <gi...@apache.org>.
laizuan commented on issue #330:
URL: https://github.com/apache/doris-flink-connector/issues/330#issuecomment-1991436864

   > @laizuan can you provide the ddl of mysql source table?
   
   @vinlee19 DDL after desensitization
   
   ```sql
   
   CREATE TABLE `x`.`xxx`  (
     `id` bigint NOT NULL COMMENT '主键',
     `xxx` bit(1) NOT NULL COMMENT 'xxx',
      ......other fields
     PRIMARY KEY (`id`) USING BTREE
   ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic;
   
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


Re: [I] [Bug] Mysql bit 类型字段生成Doris schema 错误 [doris-flink-connector]

Posted by "vinlee19 (via GitHub)" <gi...@apache.org>.
vinlee19 commented on issue #330:
URL: https://github.com/apache/doris-flink-connector/issues/330#issuecomment-1991538178

   The main issue is the mismatch between the default values of MySQL and Doris, resulting in DDL errors. Solutions: 1. Use Flink Connector version 1.5.1. 2. Wait for the next version to fix it.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


Re: [I] [Bug] Mysql bit 类型字段生成Doris schema 错误 [doris-flink-connector]

Posted by "zhbdesign (via GitHub)" <gi...@apache.org>.
zhbdesign commented on issue #330:
URL: https://github.com/apache/doris-flink-connector/issues/330#issuecomment-1982241733

   mysql是bit,对应flink的是BINARY(⌈(n + 7) / 8⌉),可以用flink的DECODE(binary, string)函数试试


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


Re: [I] [Bug] Mysql bit 类型字段生成Doris schema 错误 [doris-flink-connector]

Posted by "vinlee19 (via GitHub)" <gi...@apache.org>.
vinlee19 commented on issue #330:
URL: https://github.com/apache/doris-flink-connector/issues/330#issuecomment-1991249102

   @laizuan can you provide the ddl of mysql source table? 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org