data-integrations / database-plugins

Database plugins
Other
14 stars 30 forks source link

Fix non-nullable datetime when zeroDateTimeBehavior is CONVERT_TO_NULL. #489

Closed damjad closed 4 months ago

damjad commented 7 months ago

It's for the issue https://github.com/data-integrations/database-plugins/issues/488

The fix contains a check if the zeroDateTimeBehavior is to convert to null, make all date time like columns nullable.

damjad commented 6 months ago

Hello @itsankit-google,

Is there anything more that needs to be done?

damjad commented 5 months ago

Hello @itsankit-google,

Could you please have a look? Could you please guide me if there's anything more that should be done?

We need this patch when we upgrade to the latest version of data fusion. Thanks!

damjad commented 5 months ago

I have added the tests and run them.

I ran the following command:

mvn test -Dtest="MysqlSchemaReaderUnitTest,MysqlUtilUnitTest"

The output is as follows:

[INFO] -------------------------------------------------------
[INFO]  T E S T S
[INFO] -------------------------------------------------------
[INFO] Running io.cdap.plugin.mysql.MysqlSchemaReaderUnitTest
[INFO] Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.814 s - in io.cdap.plugin.mysql.MysqlSchemaReaderUnitTest
[INFO] validateZeroDateTimeBehavior(io.cdap.plugin.mysql.MysqlSchemaReaderUnitTest)  Time elapsed: 0.741 s
[INFO] validateYearTypeToStringTypeConversion(io.cdap.plugin.mysql.MysqlSchemaReaderUnitTest)  Time elapsed: 0.007 s
[INFO] Running io.cdap.plugin.mysql.MysqlUtilUnitTest
[INFO] Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.064 s - in io.cdap.plugin.mysql.MysqlUtilUnitTest
[INFO] testIsZeroDateTimeToNull(io.cdap.plugin.mysql.MysqlUtilUnitTest)  Time elapsed: 0.004 s
[INFO] testIsDateTimeLikeType(io.cdap.plugin.mysql.MysqlUtilUnitTest)  Time elapsed: 0 s
[INFO] 
[INFO] Results:
[INFO] 
[INFO] Tests run: 4, Failures: 0, Errors: 0, Skipped: 0
itsankit-google commented 4 months ago

Please squash commits before we merge the PR, you can refer to steps here: https://github.com/data-integrations/firestore-plugins/pull/18#issuecomment-1965094961

damjad commented 4 months ago

@itsankit-google squashed 🎊