Re: [PR] IGNITE-25716 Change TIME dynamic parameter default precision to 6 [ignite-3]

2025-07-22 Thread via GitHub


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


##
modules/sql-engine/src/integrationTest/java/org/apache/ignite/internal/sql/engine/ItTemporalIndexTest.java:
##
@@ -70,10 +70,10 @@ static void initTestData() {
 .app("CREATE TABLE TIME1 (pk TIME, val TIME, PRIMARY KEY USING 
SORTED (pk));").nl()
 .app("CREATE TABLE TIME2 (pk TIME, val TIME, PRIMARY KEY USING 
HASH (pk));").nl()
 .app("CREATE TABLE TIMESTAMP1 (pk TIMESTAMP, val TIMESTAMP, 
PRIMARY KEY USING SORTED (pk));").nl()
-.app("CREATE TABLE TIMESTAMP2 (pk TIMESTAMP, val TIMESTAMP, 
PRIMARY KEY USING HASH (pk));").nl()
+.app("CREATE TABLE TIMESTAMP2 (pk TIMESTAMP(0), val TIMESTAMP, 
PRIMARY KEY USING HASH (pk));").nl()

Review Comment:
   To check the issue with indexes and TIMESTAMP dynamic parameter.
   When the TIMESTAMP column precision is lower than the dynamic parameter 
precision, indexes are not used now. This issue is fixed in this patch (see 
change in TypeUtils).



-- 
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-25716 Change TIME dynamic parameter default precision to 6 [ignite-3]

2025-07-22 Thread via GitHub


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


##
modules/sql-engine/src/integrationTest/java/org/apache/ignite/internal/sql/engine/ItTemporalIndexTest.java:
##
@@ -70,10 +70,10 @@ static void initTestData() {
 .app("CREATE TABLE TIME1 (pk TIME, val TIME, PRIMARY KEY USING 
SORTED (pk));").nl()
 .app("CREATE TABLE TIME2 (pk TIME, val TIME, PRIMARY KEY USING 
HASH (pk));").nl()
 .app("CREATE TABLE TIMESTAMP1 (pk TIMESTAMP, val TIMESTAMP, 
PRIMARY KEY USING SORTED (pk));").nl()
-.app("CREATE TABLE TIMESTAMP2 (pk TIMESTAMP, val TIMESTAMP, 
PRIMARY KEY USING HASH (pk));").nl()
+.app("CREATE TABLE TIMESTAMP2 (pk TIMESTAMP(0), val TIMESTAMP, 
PRIMARY KEY USING HASH (pk));").nl()

Review Comment:
   To check the issue with indexes and TIMESTAMP dynamic parameter.
   When the column precision is lower than the dynamic parameter precision, 
indexes are not used now. This issue is fixed in this patch (see change in 
TypeUtils).



-- 
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-25716 Change TIME dynamic parameter default precision to 6 [ignite-3]

2025-07-22 Thread via GitHub


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


##
modules/sql-engine/src/integrationTest/java/org/apache/ignite/internal/sql/engine/ItTemporalIndexTest.java:
##
@@ -70,10 +70,10 @@ static void initTestData() {
 .app("CREATE TABLE TIME1 (pk TIME, val TIME, PRIMARY KEY USING 
SORTED (pk));").nl()
 .app("CREATE TABLE TIME2 (pk TIME, val TIME, PRIMARY KEY USING 
HASH (pk));").nl()
 .app("CREATE TABLE TIMESTAMP1 (pk TIMESTAMP, val TIMESTAMP, 
PRIMARY KEY USING SORTED (pk));").nl()
-.app("CREATE TABLE TIMESTAMP2 (pk TIMESTAMP, val TIMESTAMP, 
PRIMARY KEY USING HASH (pk));").nl()
+.app("CREATE TABLE TIMESTAMP2 (pk TIMESTAMP(0), val TIMESTAMP, 
PRIMARY KEY USING HASH (pk));").nl()

Review Comment:
   To check the issue with indexes and TIMESTAMP dynamic parameter.
   When the column precision is lower than the dynamic parameter precision, 
indexes are not used now. This issue is fixed in this patch (see change in 
RexUtils).



-- 
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-25716 Change TIME dynamic parameter default precision to 6 [ignite-3]

2025-07-22 Thread via GitHub


zstan commented on code in PR #6274:
URL: https://github.com/apache/ignite-3/pull/6274#discussion_r636581


##
modules/sql-engine/src/integrationTest/java/org/apache/ignite/internal/sql/engine/ItTemporalIndexTest.java:
##
@@ -70,10 +70,10 @@ static void initTestData() {
 .app("CREATE TABLE TIME1 (pk TIME, val TIME, PRIMARY KEY USING 
SORTED (pk));").nl()
 .app("CREATE TABLE TIME2 (pk TIME, val TIME, PRIMARY KEY USING 
HASH (pk));").nl()
 .app("CREATE TABLE TIMESTAMP1 (pk TIMESTAMP, val TIMESTAMP, 
PRIMARY KEY USING SORTED (pk));").nl()
-.app("CREATE TABLE TIMESTAMP2 (pk TIMESTAMP, val TIMESTAMP, 
PRIMARY KEY USING HASH (pk));").nl()
+.app("CREATE TABLE TIMESTAMP2 (pk TIMESTAMP(0), val TIMESTAMP, 
PRIMARY KEY USING HASH (pk));").nl()

Review Comment:
   the same as for time - why we need such a change ? 



-- 
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-25716 Change TIME dynamic parameter default precision to 6 [ignite-3]

2025-07-22 Thread via GitHub


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


##
modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/prepare/IgniteSqlValidator.java:
##
@@ -128,6 +128,7 @@ public class IgniteSqlValidator extends SqlValidatorImpl {
 public static final int MAX_LENGTH_OF_ALIASES = 256;
 public static final int DECIMAL_DYNAMIC_PARAM_PRECISION = 28;
 public static final int DECIMAL_DYNAMIC_PARAM_SCALE = 6;
+private static final int TIME_DYNAMIC_PARAM_PRECISION = 6;

Review Comment:
   I changed precision to 9 (nanoseconds). Thanks.



-- 
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-25716 Change TIME dynamic parameter default precision to 6 [ignite-3]

2025-07-22 Thread via GitHub


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


##
modules/sql-engine/src/integrationTest/java/org/apache/ignite/internal/sql/engine/ItTemporalIndexTest.java:
##
@@ -68,12 +68,12 @@ static void initTestData() {
 .app("CREATE TABLE DATE1 (pk DATE, val DATE, PRIMARY KEY USING 
SORTED (pk));").nl()
 .app("CREATE TABLE DATE2 (pk DATE, val DATE, PRIMARY KEY USING 
HASH (pk));").nl()
 .app("CREATE TABLE TIME1 (pk TIME, val TIME, PRIMARY KEY USING 
SORTED (pk));").nl()
-.app("CREATE TABLE TIME2 (pk TIME, val TIME, PRIMARY KEY USING 
HASH (pk));").nl()
+.app("CREATE TABLE TIME2 (pk TIME(6), val TIME, PRIMARY KEY 
USING HASH (pk));").nl()

Review Comment:
   I added this for consistency, for example if a dynamic parameter had a 
default precision of 0 (although for consistency it was probably necessary to 
set precision = 9).
   Anyway I think you're right, we don't need it.
   Reverted this change, thanks.



-- 
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-25716 Change TIME dynamic parameter default precision to 6 [ignite-3]

2025-07-22 Thread via GitHub


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


##
modules/sql-engine/src/integrationTest/java/org/apache/ignite/internal/sql/engine/ItTemporalIndexTest.java:
##
@@ -68,12 +68,12 @@ static void initTestData() {
 .app("CREATE TABLE DATE1 (pk DATE, val DATE, PRIMARY KEY USING 
SORTED (pk));").nl()
 .app("CREATE TABLE DATE2 (pk DATE, val DATE, PRIMARY KEY USING 
HASH (pk));").nl()
 .app("CREATE TABLE TIME1 (pk TIME, val TIME, PRIMARY KEY USING 
SORTED (pk));").nl()
-.app("CREATE TABLE TIME2 (pk TIME, val TIME, PRIMARY KEY USING 
HASH (pk));").nl()
+.app("CREATE TABLE TIME2 (pk TIME(6), val TIME, PRIMARY KEY 
USING HASH (pk));").nl()

Review Comment:
   I added this for consistency, for example if a dynamic parameter had a 
default precision of 0.
   But you're right, we don't need it.
   Reverted this change, thanks.



-- 
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-25716 Change TIME dynamic parameter default precision to 6 [ignite-3]

2025-07-22 Thread via GitHub


zstan commented on code in PR #6274:
URL: https://github.com/apache/ignite-3/pull/6274#discussion_r2221601766


##
modules/sql-engine/src/integrationTest/java/org/apache/ignite/internal/sql/engine/ItTemporalIndexTest.java:
##
@@ -68,12 +68,12 @@ static void initTestData() {
 .app("CREATE TABLE DATE1 (pk DATE, val DATE, PRIMARY KEY USING 
SORTED (pk));").nl()
 .app("CREATE TABLE DATE2 (pk DATE, val DATE, PRIMARY KEY USING 
HASH (pk));").nl()
 .app("CREATE TABLE TIME1 (pk TIME, val TIME, PRIMARY KEY USING 
SORTED (pk));").nl()
-.app("CREATE TABLE TIME2 (pk TIME, val TIME, PRIMARY KEY USING 
HASH (pk));").nl()
+.app("CREATE TABLE TIME2 (pk TIME(6), val TIME, PRIMARY KEY 
USING HASH (pk));").nl()

Review Comment:
   why do we need such a change ?



-- 
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-25716 Change TIME dynamic parameter default precision to 6 [ignite-3]

2025-07-18 Thread via GitHub


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


##
modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/prepare/IgniteSqlValidator.java:
##
@@ -128,6 +128,7 @@ public class IgniteSqlValidator extends SqlValidatorImpl {
 public static final int MAX_LENGTH_OF_ALIASES = 256;
 public static final int DECIMAL_DYNAMIC_PARAM_PRECISION = 28;
 public static final int DECIMAL_DYNAMIC_PARAM_SCALE = 6;
+private static final int TIME_DYNAMIC_PARAM_PRECISION = 6;

Review Comment:
   I set the value to `6` only because TIMESTAMP has a default precision of `6`.
   Maybe it's worth setting the value to `9` (for the future). Because it 
doesn't affect any resources.
   If no one is against it, I'll change it to `9` a little later.



-- 
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-25716 Change TIME dynamic parameter default precision to 6 [ignite-3]

2025-07-18 Thread via GitHub


zstan commented on code in PR #6274:
URL: https://github.com/apache/ignite-3/pull/6274#discussion_r2215845282


##
modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/prepare/IgniteSqlValidator.java:
##
@@ -128,6 +128,7 @@ public class IgniteSqlValidator extends SqlValidatorImpl {
 public static final int MAX_LENGTH_OF_ALIASES = 256;
 public static final int DECIMAL_DYNAMIC_PARAM_PRECISION = 28;
 public static final int DECIMAL_DYNAMIC_PARAM_SCALE = 6;
+private static final int TIME_DYNAMIC_PARAM_PRECISION = 6;

Review Comment:
   why 6 and not 3 (calcite limitation) or 9 (nanoseconds) ?



-- 
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-25716 Change TIME dynamic parameter default precision to 6 [ignite-3]

2025-07-18 Thread via GitHub


zstan commented on code in PR #6274:
URL: https://github.com/apache/ignite-3/pull/6274#discussion_r2215845282


##
modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/prepare/IgniteSqlValidator.java:
##
@@ -128,6 +128,7 @@ public class IgniteSqlValidator extends SqlValidatorImpl {
 public static final int MAX_LENGTH_OF_ALIASES = 256;
 public static final int DECIMAL_DYNAMIC_PARAM_PRECISION = 28;
 public static final int DECIMAL_DYNAMIC_PARAM_SCALE = 6;
+private static final int TIME_DYNAMIC_PARAM_PRECISION = 6;

Review Comment:
   why 6 and not 3 or 9 ?



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