[MCOL-1792] Timestamp --> Datetime insert: milliseconds are wrongly inserted in CS Created: 2018-10-11  Updated: 2023-10-26  Resolved: 2018-11-09

Status: Closed
Project: MariaDB ColumnStore
Component/s: None
Affects Version/s: 1.2.0
Fix Version/s: 1.2.1

Type: Bug Priority: Major
Reporter: Elena Kotsinova (Inactive) Assignee: Elena Kotsinova (Inactive)
Resolution: Fixed Votes: 0
Labels: None

Attachments: Zip Archive Timestamp.zip    
Issue Links:
Relates
relates to MCOL-1516 DateTime ingestion corner case - wron... Closed
Sprint: 2018-20

 Description   

Using PDI bulk adapter the following issue is found:
1. PDI type Timstamp is loaded into CS Datetime field using CSV file.
2. The value of the field is 2018-01-01 00:00:01.220
and this field should be loaded in CS DATETIME (6) field.

Result observed in CS after load is:
2018/01/01 00:00:01.000022000

Expected:
2018/01/01 00:00:01.220000000

Notes:
I tried with direct insert into CS and this works correctly.
So issue lays somewhere in PDI adapter or api.

PDI job script is attached.
@Jens, could you please add it to automated tests?



 Comments   
Comment by Jens Röwekamp (Inactive) [ 2018-10-11 ]

It's a bug in mcsapi and therefore affecting PDI, remote cpimport and the Informatica PowerCenter adapters alike.

elena.kotsinova: I added a test in mcsapi (which currently fails) and your test to PDI (which currently fails).

As its a bug in the C++ part of mcsapi I'll hand it over to you LinuxJedi

For QA:

  • build and install mcsapi from the MCOL-1792 branch (or if already merged from develop)
  • execute mcsapi's regression test suite
  • build the PDI plugin from the MCOL-1792 branch (or if already merged from develop)
  • execute PDI's regression test suite

Please test on Windows 10, one Debian / Ubuntu and CentOS 7.

Comment by Andrew Hutchings (Inactive) [ 2018-11-05 ]

Jens' test had a flaw in it:

mcsapi::ColumnStoreTime tp3(0, 1, 15, 42, false);

Should evaluate to 000042 since you only specified 42 microsesconds. The issue with this bug is if the string "00:01:15.42" had been specified this should convert to 420000 since this is 0.42 seconds. But it was converting to 000042.

My patch fixes this as well as that test case and adds a new test case (mcol1792.cpp)

Generated at Thu Feb 08 02:31:24 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.