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/03/24 14:06:29 UTC
[PR] IGNITE-24835 Forbid use of TIMESTAMP_TZ at parser level. [ignite-3]
xtern opened a new pull request, #5490:
URL: https://github.com/apache/ignite-3/pull/5490
https://issues.apache.org/jira/browse/IGNITE-24835
--
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-24835 Forbid use of TIMESTAMP_TZ at parser level. [ignite-3]
Posted by "xtern (via GitHub)" <gi...@apache.org>.
xtern commented on code in PR #5490:
URL: https://github.com/apache/ignite-3/pull/5490#discussion_r2015722777
##########
modules/sql-engine/src/main/codegen/includes/parserImpls.ftl:
##########
@@ -675,19 +675,32 @@ SqlTypeNameSpec IgniteDateTimeTypeName() :
|
<TIME> { s = span(); }
precision = PrecisionOpt()
+ (<WITHOUT> <TIME> <ZONE>)?
{
typeName = SqlTypeName.TIME;
return new SqlBasicTypeNameSpec(typeName, precision, s.end(this));
}
|
<TIMESTAMP> { s = span(); }
precision = PrecisionOpt()
- typeName = TimeZoneOpt(false)
+ typeName = TimestampZoneOpt()
{
return new SqlBasicTypeNameSpec(typeName, precision, s.end(this));
}
}
+SqlTypeName TimestampZoneOpt() :
+{
+}
+{
+ LOOKAHEAD(3)
Review Comment:
Thanks, looks redundant.
Was copy pasted from calcite :roll_eyes:
--
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-24835 Forbid use of TIMESTAMP_TZ at parser level. [ignite-3]
Posted by "xtern (via GitHub)" <gi...@apache.org>.
xtern merged PR #5490:
URL: https://github.com/apache/ignite-3/pull/5490
--
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-24835 Forbid use of TIMESTAMP_TZ at parser level. [ignite-3]
Posted by "xtern (via GitHub)" <gi...@apache.org>.
xtern commented on code in PR #5490:
URL: https://github.com/apache/ignite-3/pull/5490#discussion_r2013590054
##########
modules/sql-engine/src/test/java/org/apache/ignite/internal/sql/engine/sql/SqlDdlParserTest.java:
##########
@@ -767,15 +770,36 @@ public void dropIndexIfExists() {
}
/**
- * Ensures that the user cannot use the TIME_WITH_LOCAL_TIME_ZONE and TIMESTAMP_WITH_LOCAL_TIME_ZONE types for table columns.
+ * Ensures that the parser throws the expected exception when attempting to use the following unsupported types for table columns.
+ *
+ * <ol>
+ * <li>{@link SqlTypeName#TIME_TZ TIME WITH TIME ZONE}</li>
+ * <li>{@link SqlTypeName#TIME_WITH_LOCAL_TIME_ZONE TIME WITH LOCAL TIME ZONE}</li>
+ * <li>{@link SqlTypeName#TIMESTAMP_TZ TIMESTAMP WITH TIME ZONE}</li>
+ * </ol>
*/
// TODO: Remove after https://issues.apache.org/jira/browse/IGNITE-21555 is implemented.
- @Test
- public void timeWithLocalTimeZoneIsNotSupported() {
+ @ParameterizedTest(name = "ензу={0}")
+ @CsvSource({
+ "TIME WITH TIME ZONE, Encountered \"WITH\"",
+ "TIME WITH LOCAL TIME ZONE, Encountered \"WITH\"",
+ "TIME WITHOUT TIME ZONE, Encountered \"WITHOUT\"",
+ "TIME WITHOUT LOCAL TIME ZONE, Encountered \"WITHOUT\"",
+ "TIMESTAMP WITH TIME ZONE, Encountered \"TIME\"",
+ "TIMESTAMP WITHOUT TIME ZONE, Encountered \"WITHOUT\"",
Review Comment:
I thought that since we don't support "WITH TIME ZONE" we should not support "WITHOUT TIME ZONE"
The standard says the following, but I'm not entirely sure it applies to this case.
```
Without Feature F411, “Time zone specification”, conforming SQL language shall not contain <with or
without time zone>.
```
--
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-24835 Forbid use of TIMESTAMP_TZ at parser level. [ignite-3]
Posted by "xtern (via GitHub)" <gi...@apache.org>.
xtern commented on code in PR #5490:
URL: https://github.com/apache/ignite-3/pull/5490#discussion_r2013590054
##########
modules/sql-engine/src/test/java/org/apache/ignite/internal/sql/engine/sql/SqlDdlParserTest.java:
##########
@@ -767,15 +770,36 @@ public void dropIndexIfExists() {
}
/**
- * Ensures that the user cannot use the TIME_WITH_LOCAL_TIME_ZONE and TIMESTAMP_WITH_LOCAL_TIME_ZONE types for table columns.
+ * Ensures that the parser throws the expected exception when attempting to use the following unsupported types for table columns.
+ *
+ * <ol>
+ * <li>{@link SqlTypeName#TIME_TZ TIME WITH TIME ZONE}</li>
+ * <li>{@link SqlTypeName#TIME_WITH_LOCAL_TIME_ZONE TIME WITH LOCAL TIME ZONE}</li>
+ * <li>{@link SqlTypeName#TIMESTAMP_TZ TIMESTAMP WITH TIME ZONE}</li>
+ * </ol>
*/
// TODO: Remove after https://issues.apache.org/jira/browse/IGNITE-21555 is implemented.
- @Test
- public void timeWithLocalTimeZoneIsNotSupported() {
+ @ParameterizedTest(name = "ензу={0}")
+ @CsvSource({
+ "TIME WITH TIME ZONE, Encountered \"WITH\"",
+ "TIME WITH LOCAL TIME ZONE, Encountered \"WITH\"",
+ "TIME WITHOUT TIME ZONE, Encountered \"WITHOUT\"",
+ "TIME WITHOUT LOCAL TIME ZONE, Encountered \"WITHOUT\"",
+ "TIMESTAMP WITH TIME ZONE, Encountered \"TIME\"",
+ "TIMESTAMP WITHOUT TIME ZONE, Encountered \"WITHOUT\"",
Review Comment:
I thought that since we don't support "WITH TIME ZONE" we should not support "WITHOUT TIME ZONE"
```
Without Feature F411, “Time zone specification”, conforming SQL language shall not contain <with or
without time zone>.
```
--
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-24835 Forbid use of TIMESTAMP_TZ at parser level. [ignite-3]
Posted by "xtern (via GitHub)" <gi...@apache.org>.
xtern commented on code in PR #5490:
URL: https://github.com/apache/ignite-3/pull/5490#discussion_r2015722777
##########
modules/sql-engine/src/main/codegen/includes/parserImpls.ftl:
##########
@@ -675,19 +675,32 @@ SqlTypeNameSpec IgniteDateTimeTypeName() :
|
<TIME> { s = span(); }
precision = PrecisionOpt()
+ (<WITHOUT> <TIME> <ZONE>)?
{
typeName = SqlTypeName.TIME;
return new SqlBasicTypeNameSpec(typeName, precision, s.end(this));
}
|
<TIMESTAMP> { s = span(); }
precision = PrecisionOpt()
- typeName = TimeZoneOpt(false)
+ typeName = TimestampZoneOpt()
{
return new SqlBasicTypeNameSpec(typeName, precision, s.end(this));
}
}
+SqlTypeName TimestampZoneOpt() :
+{
+}
+{
+ LOOKAHEAD(3)
Review Comment:
Thanks, removed, looks redundant.
Was copy pasted from calcite :roll_eyes:
--
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-24835 Forbid use of TIMESTAMP_TZ at parser level. [ignite-3]
Posted by "zstan (via GitHub)" <gi...@apache.org>.
zstan commented on code in PR #5490:
URL: https://github.com/apache/ignite-3/pull/5490#discussion_r2013543299
##########
modules/sql-engine/src/test/java/org/apache/ignite/internal/sql/engine/sql/SqlDdlParserTest.java:
##########
@@ -767,15 +770,36 @@ public void dropIndexIfExists() {
}
/**
- * Ensures that the user cannot use the TIME_WITH_LOCAL_TIME_ZONE and TIMESTAMP_WITH_LOCAL_TIME_ZONE types for table columns.
+ * Ensures that the parser throws the expected exception when attempting to use the following unsupported types for table columns.
+ *
+ * <ol>
+ * <li>{@link SqlTypeName#TIME_TZ TIME WITH TIME ZONE}</li>
+ * <li>{@link SqlTypeName#TIME_WITH_LOCAL_TIME_ZONE TIME WITH LOCAL TIME ZONE}</li>
+ * <li>{@link SqlTypeName#TIMESTAMP_TZ TIMESTAMP WITH TIME ZONE}</li>
+ * </ol>
*/
// TODO: Remove after https://issues.apache.org/jira/browse/IGNITE-21555 is implemented.
- @Test
- public void timeWithLocalTimeZoneIsNotSupported() {
+ @ParameterizedTest(name = "ензу={0}")
+ @CsvSource({
+ "TIME WITH TIME ZONE, Encountered \"WITH\"",
+ "TIME WITH LOCAL TIME ZONE, Encountered \"WITH\"",
+ "TIME WITHOUT TIME ZONE, Encountered \"WITHOUT\"",
+ "TIME WITHOUT LOCAL TIME ZONE, Encountered \"WITHOUT\"",
+ "TIMESTAMP WITH TIME ZONE, Encountered \"TIME\"",
+ "TIMESTAMP WITHOUT TIME ZONE, Encountered \"WITHOUT\"",
Review Comment:
do we need to treat "TIMESTAMP WITHOUT TIME ZONE" as simple TIMEZONE syntax ?
##########
modules/sql-engine/src/test/java/org/apache/ignite/internal/sql/engine/sql/SqlDdlParserTest.java:
##########
@@ -767,15 +770,36 @@ public void dropIndexIfExists() {
}
/**
- * Ensures that the user cannot use the TIME_WITH_LOCAL_TIME_ZONE and TIMESTAMP_WITH_LOCAL_TIME_ZONE types for table columns.
+ * Ensures that the parser throws the expected exception when attempting to use the following unsupported types for table columns.
+ *
+ * <ol>
+ * <li>{@link SqlTypeName#TIME_TZ TIME WITH TIME ZONE}</li>
+ * <li>{@link SqlTypeName#TIME_WITH_LOCAL_TIME_ZONE TIME WITH LOCAL TIME ZONE}</li>
+ * <li>{@link SqlTypeName#TIMESTAMP_TZ TIMESTAMP WITH TIME ZONE}</li>
+ * </ol>
*/
// TODO: Remove after https://issues.apache.org/jira/browse/IGNITE-21555 is implemented.
- @Test
- public void timeWithLocalTimeZoneIsNotSupported() {
+ @ParameterizedTest(name = "ензу={0}")
Review Comment:
"ензу" is kinda battle cry ))
##########
modules/sql-engine/src/test/java/org/apache/ignite/internal/sql/engine/sql/SqlDdlParserTest.java:
##########
@@ -767,15 +770,36 @@ public void dropIndexIfExists() {
}
/**
- * Ensures that the user cannot use the TIME_WITH_LOCAL_TIME_ZONE and TIMESTAMP_WITH_LOCAL_TIME_ZONE types for table columns.
+ * Ensures that the parser throws the expected exception when attempting to use the following unsupported types for table columns.
+ *
+ * <ol>
+ * <li>{@link SqlTypeName#TIME_TZ TIME WITH TIME ZONE}</li>
+ * <li>{@link SqlTypeName#TIME_WITH_LOCAL_TIME_ZONE TIME WITH LOCAL TIME ZONE}</li>
+ * <li>{@link SqlTypeName#TIMESTAMP_TZ TIMESTAMP WITH TIME ZONE}</li>
+ * </ol>
*/
// TODO: Remove after https://issues.apache.org/jira/browse/IGNITE-21555 is implemented.
- @Test
- public void timeWithLocalTimeZoneIsNotSupported() {
+ @ParameterizedTest(name = "ензу={0}")
+ @CsvSource({
+ "TIME WITH TIME ZONE, Encountered \"WITH\"",
+ "TIME WITH LOCAL TIME ZONE, Encountered \"WITH\"",
+ "TIME WITHOUT TIME ZONE, Encountered \"WITHOUT\"",
+ "TIME WITHOUT LOCAL TIME ZONE, Encountered \"WITHOUT\"",
Review Comment:
check SqlTypeName TimeZoneOpt(boolean timeType) in Parser.jj, WITHOUT **local** TIME ZONE is not acceptable, thus this case need to be removed from test
--
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-24835 Forbid use of TIMESTAMP_TZ at parser level. [ignite-3]
Posted by "xtern (via GitHub)" <gi...@apache.org>.
xtern commented on code in PR #5490:
URL: https://github.com/apache/ignite-3/pull/5490#discussion_r2015722777
##########
modules/sql-engine/src/main/codegen/includes/parserImpls.ftl:
##########
@@ -675,19 +675,32 @@ SqlTypeNameSpec IgniteDateTimeTypeName() :
|
<TIME> { s = span(); }
precision = PrecisionOpt()
+ (<WITHOUT> <TIME> <ZONE>)?
{
typeName = SqlTypeName.TIME;
return new SqlBasicTypeNameSpec(typeName, precision, s.end(this));
}
|
<TIMESTAMP> { s = span(); }
precision = PrecisionOpt()
- typeName = TimeZoneOpt(false)
+ typeName = TimestampZoneOpt()
{
return new SqlBasicTypeNameSpec(typeName, precision, s.end(this));
}
}
+SqlTypeName TimestampZoneOpt() :
+{
+}
+{
+ LOOKAHEAD(3)
Review Comment:
Thanks, looks redundant.
Was copy pasted from calcite :roll_eyes:
Removed.
--
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-24835 Forbid use of TIMESTAMP_TZ at parser level. [ignite-3]
Posted by "xtern (via GitHub)" <gi...@apache.org>.
xtern commented on code in PR #5490:
URL: https://github.com/apache/ignite-3/pull/5490#discussion_r2014374125
##########
modules/sql-engine/src/test/java/org/apache/ignite/internal/sql/engine/sql/SqlDdlParserTest.java:
##########
@@ -767,15 +770,36 @@ public void dropIndexIfExists() {
}
/**
- * Ensures that the user cannot use the TIME_WITH_LOCAL_TIME_ZONE and TIMESTAMP_WITH_LOCAL_TIME_ZONE types for table columns.
+ * Ensures that the parser throws the expected exception when attempting to use the following unsupported types for table columns.
+ *
+ * <ol>
+ * <li>{@link SqlTypeName#TIME_TZ TIME WITH TIME ZONE}</li>
+ * <li>{@link SqlTypeName#TIME_WITH_LOCAL_TIME_ZONE TIME WITH LOCAL TIME ZONE}</li>
+ * <li>{@link SqlTypeName#TIMESTAMP_TZ TIMESTAMP WITH TIME ZONE}</li>
+ * </ol>
*/
// TODO: Remove after https://issues.apache.org/jira/browse/IGNITE-21555 is implemented.
- @Test
- public void timeWithLocalTimeZoneIsNotSupported() {
+ @ParameterizedTest(name = "ензу={0}")
+ @CsvSource({
+ "TIME WITH TIME ZONE, Encountered \"WITH\"",
+ "TIME WITH LOCAL TIME ZONE, Encountered \"WITH\"",
+ "TIME WITHOUT TIME ZONE, Encountered \"WITHOUT\"",
+ "TIME WITHOUT LOCAL TIME ZONE, Encountered \"WITHOUT\"",
+ "TIMESTAMP WITH TIME ZONE, Encountered \"TIME\"",
+ "TIMESTAMP WITHOUT TIME ZONE, Encountered \"WITHOUT\"",
Review Comment:
Added `WITHOUT TIME ZONE` syntax.
--
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-24835 Forbid use of TIMESTAMP_TZ at parser level. [ignite-3]
Posted by "zstan (via GitHub)" <gi...@apache.org>.
zstan commented on code in PR #5490:
URL: https://github.com/apache/ignite-3/pull/5490#discussion_r2015663044
##########
modules/sql-engine/src/main/codegen/includes/parserImpls.ftl:
##########
@@ -675,19 +675,32 @@ SqlTypeNameSpec IgniteDateTimeTypeName() :
|
<TIME> { s = span(); }
precision = PrecisionOpt()
+ (<WITHOUT> <TIME> <ZONE>)?
{
typeName = SqlTypeName.TIME;
return new SqlBasicTypeNameSpec(typeName, precision, s.end(this));
}
|
<TIMESTAMP> { s = span(); }
precision = PrecisionOpt()
- typeName = TimeZoneOpt(false)
+ typeName = TimestampZoneOpt()
{
return new SqlBasicTypeNameSpec(typeName, precision, s.end(this));
}
}
+SqlTypeName TimestampZoneOpt() :
+{
+}
+{
+ LOOKAHEAD(3)
Review Comment:
why do we need it ? did i miss smth ?
--
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-24835 Forbid use of TIMESTAMP_TZ at parser level. [ignite-3]
Posted by "xtern (via GitHub)" <gi...@apache.org>.
xtern commented on code in PR #5490:
URL: https://github.com/apache/ignite-3/pull/5490#discussion_r2013595620
##########
modules/sql-engine/src/test/java/org/apache/ignite/internal/sql/engine/sql/SqlDdlParserTest.java:
##########
@@ -767,15 +770,36 @@ public void dropIndexIfExists() {
}
/**
- * Ensures that the user cannot use the TIME_WITH_LOCAL_TIME_ZONE and TIMESTAMP_WITH_LOCAL_TIME_ZONE types for table columns.
+ * Ensures that the parser throws the expected exception when attempting to use the following unsupported types for table columns.
+ *
+ * <ol>
+ * <li>{@link SqlTypeName#TIME_TZ TIME WITH TIME ZONE}</li>
+ * <li>{@link SqlTypeName#TIME_WITH_LOCAL_TIME_ZONE TIME WITH LOCAL TIME ZONE}</li>
+ * <li>{@link SqlTypeName#TIMESTAMP_TZ TIMESTAMP WITH TIME ZONE}</li>
+ * </ol>
*/
// TODO: Remove after https://issues.apache.org/jira/browse/IGNITE-21555 is implemented.
- @Test
- public void timeWithLocalTimeZoneIsNotSupported() {
+ @ParameterizedTest(name = "ензу={0}")
+ @CsvSource({
+ "TIME WITH TIME ZONE, Encountered \"WITH\"",
+ "TIME WITH LOCAL TIME ZONE, Encountered \"WITH\"",
+ "TIME WITHOUT TIME ZONE, Encountered \"WITHOUT\"",
+ "TIME WITHOUT LOCAL TIME ZONE, Encountered \"WITHOUT\"",
Review Comment:
Agree, such cases removed from test, thanks.
##########
modules/sql-engine/src/test/java/org/apache/ignite/internal/sql/engine/sql/SqlDdlParserTest.java:
##########
@@ -767,15 +770,36 @@ public void dropIndexIfExists() {
}
/**
- * Ensures that the user cannot use the TIME_WITH_LOCAL_TIME_ZONE and TIMESTAMP_WITH_LOCAL_TIME_ZONE types for table columns.
+ * Ensures that the parser throws the expected exception when attempting to use the following unsupported types for table columns.
+ *
+ * <ol>
+ * <li>{@link SqlTypeName#TIME_TZ TIME WITH TIME ZONE}</li>
+ * <li>{@link SqlTypeName#TIME_WITH_LOCAL_TIME_ZONE TIME WITH LOCAL TIME ZONE}</li>
+ * <li>{@link SqlTypeName#TIMESTAMP_TZ TIMESTAMP WITH TIME ZONE}</li>
+ * </ol>
*/
// TODO: Remove after https://issues.apache.org/jira/browse/IGNITE-21555 is implemented.
- @Test
- public void timeWithLocalTimeZoneIsNotSupported() {
+ @ParameterizedTest(name = "ензу={0}")
Review Comment:
Thanks, fixed.
--
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