AMashenkov commented on a change in pull request #518:
URL: https://github.com/apache/ignite-3/pull/518#discussion_r775501885
##########
File path:
modules/storage-rocksdb/src/test/java/org/apache/ignite/internal/storage/rocksdb/index/RocksDbSortedIndexStorageTest.java
##########
@@ -300,85 +296,41 @@ void testEmptyRange() throws Exception {
indexStorage.put(entry1.row());
indexStorage.put(entry2.row());
- List<IndexRow> actual =
cursorToList(indexStorage.range(entry2::columns, entry1::columns));
-
- assertThat(actual, is(empty()));
- }
-
- /**
- * Tests creating a index that has not been created through the
Configuration framework.
- */
- @Test
- void testCreateMissingIndex() {
- StorageException ex = assertThrows(StorageException.class, () ->
tableStorage.getOrCreateSortedIndex("does not exist"));
-
- assertThat(ex.getMessage(), is(equalTo("Index configuration for \"does
not exist\" could not be found")));
- }
-
- /**
- * Tests creating a Sorted Index that has been misconfigured as a Hash
Index.
- */
- @Test
- void testCreateMisconfiguredIndex() {
- HashIndexDefinition definition = SchemaBuilders.hashIndex("wrong type")
- .withColumns("foo")
- .build();
-
- StorageException ex = assertThrows(StorageException.class, () ->
createIndex(definition));
-
- assertThat(ex.getMessage(), is(equalTo("Index \"wrong type\" is not
configured as a Sorted Index. Actual type: HASH")));
- }
-
- /**
- * Tests the {@link TableStorage#dropIndex} functionality.
- */
- @Test
- void testDropIndex() throws Exception {
- SortedIndexStorage storage =
createIndex(ALL_TYPES_COLUMN_DEFINITIONS.subList(0, 1));
-
- String indexName = storage.indexDescriptor().name();
-
- assertThat(tableStorage.getOrCreateSortedIndex(indexName),
is(sameInstance(storage)));
-
- IndexRowWrapper entry = IndexRowWrapper.randomRow(storage);
+ int colCount = indexStorage.indexDescriptor().columns().size();
- storage.put(entry.row());
+ List<IndexRow> actual =
cursorToList(indexStorage.range(entry2.prefix(colCount),
entry1.prefix(colCount), r -> true));
- tableStorage.dropIndex(indexName);
-
- SortedIndexStorage nextStorage =
tableStorage.getOrCreateSortedIndex(indexName);
-
- assertThat(nextStorage, is(not(sameInstance(storage))));
- assertThat(getSingle(nextStorage, entry), is(nullValue()));
+ assertThat(actual, is(empty()));
}
@ParameterizedTest
@VariableSource("ALL_TYPES_COLUMN_DEFINITIONS")
void testNullValues(ColumnDefinition columnDefinition) throws Exception {
- SortedIndexStorage storage = createIndex(List.of(columnDefinition));
-
- IndexRowWrapper entry1 = IndexRowWrapper.randomRow(storage);
-
- Object[] nullArray =
storage.indexDescriptor().indexRowColumns().stream()
- .map(columnDescriptor -> columnDescriptor.indexedColumn() ?
null : (byte) random.nextInt())
- .toArray();
-
- IndexRow nullRow = storage.indexRowFactory().createIndexRow(nullArray,
new ByteArraySearchRow(randomBytes(random, 10)));
-
- IndexRowWrapper entry2 = new IndexRowWrapper(storage, nullRow,
nullArray);
-
- storage.put(entry1.row());
- storage.put(entry2.row());
-
- if (entry1.compareTo(entry2) > 0) {
- IndexRowWrapper t = entry2;
- entry2 = entry1;
- entry1 = t;
- }
-
- List<IndexRow> rows = cursorToList(storage.range(entry1::columns,
entry2::columns));
-
- assertThat(rows, contains(entry1.row(), entry2.row()));
+ // TODO: disabled temporary
+ // SortedIndexStorage storage =
createIndex(List.of(columnDefinition));
+ //
+ // IndexRowWrapper entry1 = IndexRowWrapper.randomRow(storage);
+ //
+ // Object[] nullArray =
storage.indexDescriptor().columns().stream()
+ // .map(columnDescriptor ->
columnDescriptor.indexedColumn() ? null : (byte) random.nextInt())
+ // .toArray();
+ //
+ // IndexRow nullRow =
storage.indexRowFactory().createIndexRow(nullArray, new
ByteArraySearchRow(randomBytes(random, 10)));
+ //
+ // IndexRowWrapper entry2 = new IndexRowWrapper(storage,
nullRow, nullArray);
+ //
+ // storage.put(entry1.row());
+ // storage.put(entry2.row());
+ //
+ // if (entry1.compareTo(entry2) > 0) {
+ // IndexRowWrapper t = entry2;
+ // entry2 = entry1;
+ // entry1 = t;
+ // }
+ //
+ // List<IndexRow> rows =
cursorToList(storage.range(entry1::columns, entry2::columns));
+ //
+ // assertThat(rows, contains(entry1.row(), entry2.row()));
Review comment:
Any TODO with a ticket?
--
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]