Skip to content
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

If Timestamp/Date pattern contains both literal or variable length entry and fractions of second placeholders it's likely to cause error #7

Open
dk1844 opened this issue Dec 8, 2021 · 0 comments

Comments

@dk1844
Copy link
Contributor

dk1844 commented Dec 8, 2021

This issue is a shortcut for AbsaOSS/enceladus#677 (moving it from Enceladus to here)

Describe the bug

If Timestamp/Date pattern contains both literal parts or variable length entry (month name, day name, ...) and fractions of second placeholders namely if any literal part is before any second fraction placeholder it will fail Standardization of such filed or even crash with an exception.

To Reproduce

Steps to reproduce the behavior OR commands run:

  1. Set the timestamp pattern to "'at' HH:mm:ss.SSS"
  2. Try to Standardize or just use 'EnceladusDateTimeParser.format'
  3. Exception, wouldn't it be SSS be at the tail it would "just" fail the conversion in Standardization

Expected behavior

This needs to work properly

Additional context

The reason is that the quote characters are counted in when the position of second fractions are analyzed. But in the actual string to convert they are not present making the index out of place, even outside the boundaries.

Related to AbsaOSS/enceladus#466

dk1844 added a commit that referenced this issue Dec 8, 2021
dk1844 added a commit that referenced this issue Dec 13, 2021
* Base feature
* Update sbt version
* #1 github workflow to build, sbt-header check + github workflow
* #1 headers update (newline) to be compatible with sbt header plugin
* #1 Constants reverted to Enceladus values (test passing and Enceladus-compatiblity), created issue #5 to follow up
* #1 testfix (missing test config, typeName wrapper - typeOf[Boolean].toString returning `Boolean` vs `scala.Boolean` + test
* #1 cleanup, SectionSuite added (originating in Enceladus). `FieldValidationFailure` renamed to `FieldValidationIssue`

* #1 sbt `in` -> `/`
* #1 removed unused test resources
* #1 added header checking for src/test/scala, too. + header NL fixes, build name = small caps,
* #1 assembly removed (plugin + config)
* #1 StructFieldImplicitsSuite added, `StandardizationRerunSuite` renamed to `StandardizationCsvSuite`
* #1 Enceladus#677 changed to #7
* `StdInterpreterSuite` and `StandardizationInterpreterSuite` merged into the latter.
* #1 `StandardizationInterpreterSuite` test fix

Co-authored-by: Daniel Kavan <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant