slinkydeveloper opened a new pull request #17878:
URL: https://github.com/apache/flink/pull/17878
## What is the purpose of the change
This PR is the last step of reorganizing our printing and date time utils
code, as followed by FLINK-21456. This PR cleanups the `DateTimeUtils` class,
trying to reduce the surface of the class as much as possible.
## Brief change log
* Moved `TimestampStringUtil` in an appropriate package and document it
* Add a test for `BuildInMethods` class to make sure every reflection
defined there is valid
* Cleanup of `DateTimeUtils`. This involves:
* The types handled by this utils are: `TimestampData`, timestamp as
millis, timestamp as unix timestamp, date and time as ints (internal types).
* Renamed all the methods for parsing strings to date/time/timestamp as
`parse[type]`
* Renamed all the methods for formatting strings to `format[type]`
* Renamed the methods to convert from internal to external types as
`to[externalTypeName]` and `toInternal`
* Moved methods around the class to reorganize them in categories. Future
PRs might split these "categories" in different utils classes (where some of
these can be moved back to planner and/or runtime)
* Whenever possible, moved some methods in the only place where they're
used
* Removed all the date sub/add, which are unused by the runtime
* Removed all the unused public overloads
* Removed private unused methods
* Now AbstractCodeGeneratorCastRule generates a `CastExecutor` that properly
wraps the generated exception in a `TableException`
## Verifying this change
Added `BuildInMethodsTest` to make sure the class `BuildInMethods` is sane
and declares only existing methods. The rest of the changes should be widely
covered by the expression tests.
## Does this pull request potentially affect one of the following parts:
- Dependencies (does it add or upgrade a dependency): no
- The public API, i.e., is any changed class annotated with
`@Public(Evolving)`: no
- The serializers: no
- The runtime per-record code paths (performance sensitive): no
- Anything that affects deployment or recovery: JobManager (and its
components), Checkpointing, Kubernetes/Yarn, ZooKeeper: no
- The S3 file system connector: no
## Documentation
- Does this pull request introduce a new feature? no
- If yes, how is the feature documented? not applicable
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]