zstan commented on code in PR #1979:
URL: https://github.com/apache/ignite-3/pull/1979#discussion_r1182870095
##########
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:
ok, i talking about - if i change a sampling data, all tests need to pass ?
If it correct - this case is broke the test:
_public TestDataSamples<VarBinary> createSamples(IgniteTypeFactory
typeFactory) {
List<VarBinary> values = List.of(
VarBinary.fromBytes(new byte[]{1}), fromUtf8String("2"),
VarBinary.fromBytes(new byte[]{3}));_
also it useful to append some assertion that sample data need to be equal
size of templated params ?
_protected final void insertValues() {
runSql("INSERT INTO t VALUES(1, $0)");
runSql("INSERT INTO t VALUES(2, $1)");
runSql("INSERT INTO t VALUES(3, $2)");
}_
i.e. assert orderedValues.size() == 3 or smth like it?
--
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]