fskorgen opened a new issue, #8218:
URL: https://github.com/apache/hop/issues/8218
### Apache Hop version?
2.19
### Java version?
21
### Operating system
Windows
### What happened?
**Affected:** 2.19.0 and earlier. One-line fix.
```java
public static final String DEFAULT_TIMESTAMP_PARSE_MASK =
Const.NVL(
EnvUtil.getSystemProperty(Const.HOP_DEFAULT_DATE_FORMAT), // <--
date, not timestamp
"yyyy/MM/dd HH:mm:ss.SSSSSSSSS");
```
The default value is the timestamp pattern and the sibling
`DEFAULT_TIMESTAMP_FORMAT_MASK` reads
`HOP_DEFAULT_TIMESTAMP_FORMAT`, so the variable name is simply wrong here.
Two consequences:
- `HOP_DEFAULT_TIMESTAMP_FORMAT` has no effect on timestamp **parsing** at
all.
- Setting `HOP_DEFAULT_DATE_FORMAT` silently changes how timestamps are
parsed, which is hard to
find because the symptom shows up on a different data type than the
variable names.
### Steps to reproduce
1. Set `HOP_DEFAULT_DATE_FORMAT` to a date-only pattern, e.g. `dd-MM-yyyy`.
2. Convert a String to Timestamp without an explicit format mask, for
example in a Select values
transform.
**Expected:** the conversion uses `HOP_DEFAULT_TIMESTAMP_FORMAT`, or the
built-in timestamp pattern
when that variable is unset. `HOP_DEFAULT_DATE_FORMAT` affects Date only.
**Actual:** the timestamp is parsed with the date pattern, and setting
`HOP_DEFAULT_TIMESTAMP_FORMAT` changes nothing.
### Suggested fix
Read `Const.HOP_DEFAULT_TIMESTAMP_FORMAT`.
### Issue Priority
Priority: 2
### Issue Component
Component: API
--
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]