Skip to content
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

[Bug] Text '0000-00-00' could not be parsed: Invalid value for MonthOfYear #323

Open
2 of 3 tasks
lliuql opened this issue Feb 28, 2024 · 1 comment
Open
2 of 3 tasks

Comments

@lliuql
Copy link

lliuql commented Feb 28, 2024

Search before asking

  • I had searched in the issues and found no similar issues.

Version

flink-doris-connector-1.17-1.5.2.jar
doris-2.0.3-rc06-37d31a5
mysql5.7
flink-sql-connector-mysql-cdc-2.4.0.jar

What's Wrong?

CREATE TABLE IF NOT EXISTSxxx.asku( idLARGEINT,dateDATEV2 DEFAULT '0000-00-00',kVARCHAR(192) DEFAULT '',store_idLARGEINT DEFAULT '0',sku_idLARGEINT DEFAULT '0',product_idLARGEINT DEFAULT '0',tenant_idVARCHAR(36) DEFAULT '',day_quantity_orderedINT DEFAULT '0',day7_quantity_orderedINT DEFAULT '0',day14_quantity_orderedINT DEFAULT '0',day30_quantity_orderedINT DEFAULT '0',week_quantity_orderedINT DEFAULT '0',month_quantity_orderedINT DEFAULT '0',today_total_priceDECIMALV3(20,2) DEFAULT '0.00',day7_total_priceDECIMALV3(20,2) DEFAULT '0.00',day14_total_priceDECIMALV3(20,2) DEFAULT '0.00',day30_total_priceDECIMALV3(20,2) DEFAULT '0.00',week_total_priceDECIMALV3(20,2) DEFAULT '0.00',month_total_priceDECIMALV3(20,2) DEFAULT '0.00',today_taxDECIMALV3(20,2) DEFAULT '0.00',shipping_priceDECIMALV3(20,2) DEFAULT '0.00',shipping_taxDECIMALV3(20,2) DEFAULT '0.00',gift_wrap_priceDECIMALV3(20,2) DEFAULT '0.00',gift_wrap_taxDECIMALV3(20,2) DEFAULT '0.00',promotion_discountDECIMALV3(20,2) DEFAULT '0.00',ship_promotion_discountDECIMALV3(20,2) DEFAULT '0.00',can_sale_quantityINT DEFAULT '0',fba_on_way_quantityINT DEFAULT '0',fba_contains_on_way_quantityINT DEFAULT '0',working_quantityINT DEFAULT '0',inv_age_three_months_less_daysINT DEFAULT '0',inv_age_three_six_months_daysINT DEFAULT '0',inv_age_six_nine_months_daysINT DEFAULT '0',inv_age_nine_twelve_months_daysINT DEFAULT '0',inv_age_twelve_months_plus_daysINT DEFAULT '0',inv_age_earlier_six_monthINT DEFAULT '0',afn_unsellable_quantityINT DEFAULT '0',mfn_fulfillable_quantityINT DEFAULT '0',afn_warehouse_quantityINT DEFAULT '0',afn_fulfillable_quantityINT DEFAULT '0',afn_reserved_quantityINT DEFAULT '0',afn_total_quantityINT DEFAULT '0',afn_inbound_receiving_quantityINT DEFAULT '0',reserved_qtyINT DEFAULT '0',reserved_customer_ordersINT DEFAULT '0',reserved_fc_transfersINT DEFAULT '0',reserved_fc_processing INT DEFAULT '0' ) UNIQUE KEY(id) DISTRIBUTED BY HASH(id`) BUCKETS AUTO PROPERTIES ('replication_num'='1','light_schema_change'='true');

at org.apache.doris.flink.catalog.doris.DorisSystem.execute(DorisSystem.java:131)
at org.apache.doris.flink.catalog.doris.DorisSystem.createTable(DorisSystem.java:122)
at org.apache.doris.flink.tools.cdc.DatabaseSync.build(DatabaseSync.java:145)
at org.apache.doris.flink.tools.cdc.CdcTools.syncDatabase(CdcTools.java:146)
at org.apache.doris.flink.tools.cdc.CdcTools.createMySQLSyncDatabase(CdcTools.java:74)
at org.apache.doris.flink.tools.cdc.CdcTools.main(CdcTools.java:51)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.flink.client.program.PackagedProgram.callMainMethod(PackagedProgram.java:355)
... 12 more
Caused by: java.sql.SQLException: errCode = 2, detailMessage = date literal [0000-00-00] is invalid: Text '0000-00-00' could not be parsed: Invalid value for MonthOfYear (valid values 1 - 12): 0
at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:129)
at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:122)
at com.mysql.cj.jdbc.StatementImpl.executeInternal(StatementImpl.java:763)
at com.mysql.cj.jdbc.StatementImpl.execute(StatementImpl.java:648)
at org.apache.doris.flink.catalog.doris.DorisSystem.execute(DorisSystem.java:128)
... 22 more
`

What You Expected?

希望能兼容default的格式。有些人确实有些0000-00-00的习惯。

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

@vinlee19
Copy link
Contributor

vinlee19 commented Mar 4, 2024

You can add my Wechat: Aurora_0_618.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants