stevenzwu commented on code in PR #11775:
URL: https://github.com/apache/iceberg/pull/11775#discussion_r2113243416
##########
api/src/main/java/org/apache/iceberg/expressions/Literals.java:
##########
@@ -300,8 +300,7 @@ public <T> Literal<T> to(Type type) {
case TIMESTAMP:
return (Literal<T>) new TimestampLiteral(value());
case TIMESTAMP_NANO:
- // assume micros and convert to nanos to match the behavior in the
timestamp case above
- return new TimestampLiteral(value()).to(type);
+ return (Literal<T>) new TimestampNanoLiteral(value());
Review Comment:
long literals is implicit and some precision interpretation rule has to be
applied. The good practice is probably using the timestamp functions to
explicit describe the precision, e.g. Spark SQL
```
TIMESTAMP '2021-06-30T02:00:00.000Z'
timestamp_micros(1230219000123123)
```
Until Spark adds timestamp_nano data type and SQL function, maybe Iceberg
timestamp_nano just doesn't need to work for Spark? Also Spark can't create an
Iceberg table with timestamp_nano field. probably also reasonable for read to
fail too.
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]