Commit Graph

9 Commits

Author SHA1 Message Date
Dimitri Fontaine
d356bd501b Accept even more ragged date format input.
When parsing a date string from a date format, accept that the ms or us part
be completely missing, rather than just missing some digits.

Fixed #828.
2018-09-10 19:37:36 +02:00
Dimitri Fontaine
ab7e77c2d0 Fix double transformation call in CSV projections.
In advanced projections it could be that we call the transformation function
for some input fields twice. This is a bug that manifest in particular when
the output of the transformation can't be used/parsed again by the same
function as shown in the bug reported.

Fix #523.
2017-03-04 15:55:08 +01:00
Dimitri Fontaine
98f18c4877 Improve CSV date format, fix #293.
The date format wouldn't allow using colon (:) in the noise parts of it,
and would also insist that milliseconds should be on 4 digits and micro
seconds on 6 digits. Allow for "ragged" input and take however many
digits we actually find in the input.
2015-09-12 00:35:14 +02:00
Dimitri Fontaine
60d58a96b8 Travis: let's try to force client timezone.
The cvs-parse-date test is failing on Travis because the server up there
in the Cloud isn't using the same timezone as my local machine. Let's
just force the timezone in the SET clause...
2015-09-07 20:00:05 +02:00
Dimitri Fontaine
04b2779239 Allow date format parsing to support time.
A useful use case for date parsing at tine input level is to parse
time (hour, minutes, seconds) rather than a full date (timestamp).
Improve the code so that it's possible to use the date format facility
even when the data field lacks the year/month/day information.

Fix #288.
2015-09-07 17:05:10 +02:00
Dimitri Fontaine
b78bb6dd31 Allow quoted field names to contain spaces, fix #285.
Given a fully quoted field name, there should be no restriction about
using spaces in between the quotes, but the parser used to choke on that
case.
2015-09-01 14:32:50 +02:00
Dimitri Fontaine
b4b36caa84 Fix parsing dates with less-than 4 digits, fix #266.
The previous coding decided to add 2000 to the year as an integer if it
was below 2000, which parses 1999 as 3999. Oops. Trigger the correction
only when the date is given on 2 digits only, parsing 04 as 2004.

Dates given on 3 digits are kept as-is.

Playing with the *century* special parameter allows to cancel this
behavior, that maybe should be made entirely optional. It's just too
common to find current years on 2 digits only, sadly.
2015-07-26 14:41:44 +02:00
Dimitri Fontaine
00b002124b Travis: switch test case to timestamp, dropping the TZ.
The timezone is different in between my own machine and the test system,
just get rid of that discrepancy so that the test stop failing.
2014-10-02 01:32:19 +02:00
Dimitri Fontaine
7cf7e714fc Implement the source date format option. 2014-10-02 01:03:24 +02:00