You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ignite.apache.org by "xtern (via GitHub)" <gi...@apache.org> on 2025/07/18 10:42:25 UTC

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

xtern opened a new pull request, #6279:
URL: https://github.com/apache/ignite-3/pull/6279

   https://issues.apache.org/jira/browse/IGNITE-24984


-- 
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: notifications-unsubscribe@ignite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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

Posted by "lowka (via GitHub)" <gi...@apache.org>.
lowka commented on code in PR #6279:
URL: https://github.com/apache/ignite-3/pull/6279#discussion_r2219421017


##########
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:
   Perhaps, it is possible to have this code extracted into a utility method, so that the validator and the ddl converter use the same code?



-- 
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: notifications-unsubscribe@ignite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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

Posted by "xtern (via GitHub)" <gi...@apache.org>.
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: notifications-unsubscribe@ignite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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

Posted by "xtern (via GitHub)" <gi...@apache.org>.
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: notifications-unsubscribe@ignite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org