-
Notifications
You must be signed in to change notification settings - Fork 67
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
Convert Record Timestamps into Avro Logical Date Type #665
Comments
I found a way to convert the timestamp to an "filters.DateParser.type": "io.streamthoughts.kafka.connect.filepulse.filter.DateFilter",
"filters.DateParser.field": "$.dateAsStr",
"filters.DateParser.formats": "yyyy-MM-dd",
"filters.DateParser.target": "$.dateAsTimestamp",
"filters.DateAsDays.type": "io.streamthoughts.kafka.connect.filepulse.filter.AppendFilter",
"filters.DateAsDays.field": "$.date",
"filters.DateAsDays.value": "{{ timestamp_diff( 'DAYS', $.dateAsTimestamp, 0 ) }}",
"filters.DateAsInt.type": "io.streamthoughts.kafka.connect.filepulse.filter.ConvertFilter",
"filters.DateAsInt.field": "date",
"filters.DateAsInt.to": "INTEGER", However, the processing fails than with the schema conversion error:
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Is your feature request related to a problem? Please describe.
In avro there is a logical type date:
And it should be possible to parse fields as dates and convert it into a compliant Avro record.
Describe the solution you'd like
It would be great if
DateFilter
provides a configuration option to get access to temporal fields to be able to parse a date into a Avro compatible logical date int.Describe alternatives you've considered
I tried to convert timestamp into “number of days from the unix epoch, 1 January 1970” but I couldn't find a way express that as SCeL.
The text was updated successfully, but these errors were encountered: