Re: [PR] IGNITE-24984 Added YEAR field validation in TIMESTAMP literal [ignite-3]

2025-07-22 Thread via GitHub


xtern merged PR #6279:
URL: https://github.com/apache/ignite-3/pull/6279


-- 
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]



Re: [PR] IGNITE-24984 Added YEAR field validation in TIMESTAMP literal [ignite-3]

2025-07-21 Thread via GitHub


xtern commented on code in PR #6279:
URL: https://github.com/apache/ignite-3/pull/6279#discussion_r2221347066


##
modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/prepare/IgniteSqlValidator.java:
##
@@ -586,12 +587,24 @@ public SqlLiteral resolveLiteral(SqlLiteral literal) {
 SqlLiteral resolved = super.resolveLiteral(literal);
 SqlTypeName typeName = resolved.getTypeName();
 
-if (typeName == SqlTypeName.TIMESTAMP) {
-long ts = 
resolved.getValueAs(TimestampString.class).getMillisSinceEpoch();
+if (literal.getTypeName() != SqlTypeName.UNKNOWN) {
+return resolved;
+}
+
+if (typeName == SqlTypeName.TIMESTAMP || typeName == 
SqlTypeName.TIMESTAMP_WITH_LOCAL_TIME_ZONE) {

Review Comment:
   Thanks, moved to `TypeUtils` :thinking: 



-- 
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]