korlov42 commented on a change in pull request #216:
URL: https://github.com/apache/ignite-3/pull/216#discussion_r689397678
##########
File path:
modules/schema/src/main/java/org/apache/ignite/internal/schema/NativeTypes.java
##########
@@ -108,6 +111,65 @@ public static NativeType decimalOf(int precision, int
scale) {
return new DecimalNativeType(precision, scale);
}
+ /**
+ * Creates a TIME type with subsecond precision.
+ *
+ * @param precision Time subsecond part length in digits. Allowed values
0-9.
+ * @return Native type.
+ */
+ public static NativeType time(int precision) {
+ return TemporalNativeType.time(precision);
+ }
+
+ /**
+ * Creates DATETIME type as pair (date, time).
+ *
+ * @param precision Time subsecond part length in digits. Allowed values
0-9.
+ * @return Native type.
+ */
+ public static NativeType datetime(int precision) {
+ return TemporalNativeType.datetime(precision);
+ }
+
+ /**
+ * Creates TIMESTAMP type.
+ *
+ * @param precision Time subsecond part length. Allowed values are 3/6/9
for millis/micros/nanos.
+ * @return Native type.
+ */
+ public static NativeType timestamp(int precision) {
+ return TemporalNativeType.timestamp(precision);
+ }
+
+ /**
+ * Creates a TIME type with default precision.
+ *
+ * @return Native type.
+ * @see #time(int)
+ */
+ public static NativeType time() {
+ return
TemporalNativeType.time(ColumnType.TemporalColumnType.DEFAULT_PRECISION);
+ }
+
+ /**
+ * Creates DATETIME type with default precision.
+ *
+ * @return Native type.
+ * @see #datetime(int)
+ */
+ public static NativeType datetime() {
+ return
TemporalNativeType.datetime(ColumnType.TemporalColumnType.DEFAULT_PRECISION);
+ }
+
+ /**
+ * Creates TIMESTAMP type with default precision.
+ *
+ * @return Native type.
Review comment:
```suggestion
* @return Native type.
* @see #timestamp(int)
```
--
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]