lowka commented on code in PR #1979:
URL: https://github.com/apache/ignite-3/pull/1979#discussion_r1183294011
##########
modules/runner/src/integrationTest/java/org/apache/ignite/internal/sql/engine/datatypes/tests/DataTypeTestSpec.java:
##########
@@ -17,29 +17,36 @@
package org.apache.ignite.internal.sql.engine.datatypes.tests;
-import java.util.List;
-import org.apache.ignite.internal.sql.engine.type.IgniteCustomTypeSpec;
+import org.apache.ignite.internal.schema.NativeType;
import org.apache.ignite.internal.sql.engine.type.IgniteTypeFactory;
+import org.apache.ignite.internal.sql.engine.util.NativeTypeWrapper;
import org.apache.ignite.sql.ColumnType;
/**
- * {@link IgniteCustomTypeSpec} + its values + convenient methods.
+ * {@code DataTypeTestSpec} describes a data type, provides convenient methods
for testing.
+ *
+ * <ul>
+ * <li>If {@code storageType} is not {@link Comparable} must use provide
implementation of
+ * {@link NativeTypeWrapper} and use it instead of their storage type.</li>
+ * <li>If type has SQL literal {@link #hasLiterals()} should return {@code
true}
+ * and {@link #toLiteral(Comparable)} must convert values into
corresponding literals.</li>
+ * </ul>
+ *
+ * @param <T> java type used by tests.
*/
-public abstract class CustomDataTypeTestSpec<T extends Comparable<T>> {
+public abstract class DataTypeTestSpec<T extends Comparable<T>> {
private final ColumnType columnType;
private final String typeName;
- protected final List<T> values;
-
private final Class<?> storageType;
/** Constructor. */
- public CustomDataTypeTestSpec(ColumnType columnType, String typeName,
Class<T> javaType, T[] values) {
+ public DataTypeTestSpec(ColumnType columnType, String typeName,
@SuppressWarnings("unused") Class<T> javaType) {
Review Comment:
> VarBinary.fromBytes(new byte[]{1}), fromUtf8String("2"),
VarBinary.fromBytes(new byte[]{3}));
I ran var binary tests changing data samples to these ones and no tests
failed. It is expected since provided values are distinct.
Regarding the assertion - Moved that check from TestDataSample constructor
to BaseDataTypeTest.
--
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]