After 2 days of many permutations trying to solve a simple data load I think I may get better success on this forum.
I have a DateTime field in my Columnstore table. I am trying to import 1 row of data via a pipeline.
Here is part of the Pipeline that matters (I changed the field name to post here).
@un_hi_rec_id,
@my_ts)
SET my_ts = STR_TO_DATE(@my_ts, ‘%Y-%m-%d %h:%i:%s’),
un_hi_rec_id = @my_ts;
the field in my CSV file that maps to my_ts looks like this,
2019-06-18 19:10:19
I made the datetime string format match the SingleStore DateTime string representation.
This result of the Pipeline running is NULL for the my_ts field and proper values on the un_hi_rec_id field which I use for testing this out. The un_hi_rec_id is a TEXT data type.
.So I tried the following
SET my_ts= CONVERT(@my_ts, datetime),
un_hi_rec_id = @my_ts;
Did not work. Got NULL on the my_ts field.
However, this following did work.
SET my_ts= now(),
un_hi_rec_id = @my_ts;
Below is the string field to be loaded in CSV and the now() result after is goes into my my_ts field.
2019-06-18 19:10:19 from csv which results in NULL
2022-05-11 19:08:40 now() which loads properly
My eyes are not what they used to be but the datetime string field I have in my csv file looks identical to the result of the now() function.
How do you get a datetime string value in a csv file into a datetime field in a table using a Pipeline?