markhoerth commented on issue #14421:
URL: https://github.com/apache/gravitino/issues/14421#issuecomment-6697635667
One bad filter still returns 500 on main at commit
463296caca4082133bf12bad2bd4ed5d2572933e (2.0.0-SNAPSHOT): a timestamp without
a zone offset compared to a `timestamptz` column. A literal of the wrong type
on a `long` column, an unknown column and a case mismatch all return 400 now.
The 2.0 OSS test suite check
`test_plan_bad_filter_is_400[timestamptz_without_zone]` fails.
The filter is bound only while files are planned, so the table needs at
least one data file. On an empty table the same request returns 200.
```
POST /iceberg/v1/namespaces/{namespace}/tables/t/plan
{"filter":{"type":"eq","term":"c_tstz","value":"2024-06-01T12:00:00"}}
HTTP 500
{"error":{"message":"Scan planning failed for table gvt_repro1_plantypes.t:
Text '2024-06-01T12:00:00' could not be parsed: Unable to obtain OffsetDateTime
from TemporalAccessor: {},ISO resolved to 2024-06-01T12:00 of type
java.time.format.Parsed","type":"RuntimeException","code":500,"stack":[
...
"at
org.apache.gravitino.iceberg.service.CatalogWrapperForREST.planTableScan(CatalogWrapperForREST.java:630)",
"Caused by: java.time.format.DateTimeParseException: Text
'2024-06-01T12:00:00' could not be parsed: Unable to obtain OffsetDateTime from
TemporalAccessor: {},ISO resolved to 2024-06-01T12:00 of type
java.time.format.Parsed",
```
The same request with `"value":"2024-06-01T12:00:00+00:00"` returns 200.
Cause:
`iceberg/iceberg-rest-server/src/main/java/org/apache/gravitino/iceberg/service/CatalogWrapperForREST.java:618`
converts only `IllegalArgumentException` and `ValidationException` to a 400.
Iceberg's literal conversion raises `java.time.format.DateTimeParseException`
for this value, which falls into the `catch (Exception e)` at lines 627-630 and
becomes a `RuntimeException`, returned as 500. The exception comes from the
Iceberg library, and the handling that turns it into a 500 is in Gravitino.
--
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]