Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IGNITE-18004 Compilation fixed, test disabled. #1268

Merged
merged 3 commits into from
Oct 27, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import java.util.stream.Collectors;
import org.apache.calcite.runtime.CalciteContextException;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;

/**
Expand All @@ -46,6 +47,7 @@ public void dropTables() {

/** Tests correctness with unicode. */
@Test
@Disabled("https://issues.apache.org/jira/browse/IGNITE-18005")
public void testUnicodeStrings() {
sql("CREATE TABLE string_table(key int primary key, val varchar)");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,8 @@ public class IgniteImpl implements Ignite {
schemaManager,
dataStorageMgr,
txManager,
() -> dataStorageModules.collectSchemasFields(modules.distributed().polymorphicSchemaExtensions())
() -> dataStorageModules.collectSchemasFields(modules.distributed().polymorphicSchemaExtensions()),
clock
);

sql = new IgniteSqlImpl(qryEngine);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,8 @@ public class SqlQueryProcessor implements QueryProcessor {
/** Transaction manager. */
private final TxManager txManager;

private HybridClock clock;

/** Constructor. */
public SqlQueryProcessor(
Consumer<Function<Long, CompletableFuture<?>>> registry,
Expand All @@ -150,7 +152,8 @@ public SqlQueryProcessor(
SchemaManager schemaManager,
DataStorageManager dataStorageManager,
TxManager txManager,
Supplier<Map<String, Map<String, Class<?>>>> dataStorageFieldsSupplier
Supplier<Map<String, Map<String, Class<?>>>> dataStorageFieldsSupplier,
HybridClock clock
) {
this.registry = registry;
this.clusterSrvc = clusterSrvc;
Expand All @@ -160,6 +163,7 @@ public SqlQueryProcessor(
this.dataStorageManager = dataStorageManager;
this.txManager = txManager;
this.dataStorageFieldsSupplier = dataStorageFieldsSupplier;
this.clock = clock;
}

/** {@inheritDoc} */
Expand Down Expand Up @@ -390,7 +394,7 @@ private CompletableFuture<AsyncSqlCursor<List<Object>>> querySingle0(
})
.thenCompose(sqlNode -> {
final boolean rwOp = dataModificationOp(sqlNode);
final HybridTimestamp txTime = outerTx != null ? outerTx.readTimestamp() : rwOp ? null : new HybridClock().now();
final HybridTimestamp txTime = outerTx != null ? outerTx.readTimestamp() : rwOp ? null : clock.now();

BaseQueryContext ctx = BaseQueryContext.builder()
.frameworkConfig(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
import org.apache.ignite.configuration.ConfigurationValue;
import org.apache.ignite.internal.configuration.testframework.ConfigurationExtension;
import org.apache.ignite.internal.configuration.testframework.InjectConfiguration;
import org.apache.ignite.internal.hlc.HybridClock;
import org.apache.ignite.internal.index.IndexManager;
import org.apache.ignite.internal.logger.IgniteLogger;
import org.apache.ignite.internal.logger.Loggers;
Expand Down Expand Up @@ -127,6 +128,9 @@ public class StopCalciteModuleTest {
@Mock
InternalTable tbl;

@Mock
HybridClock clock;

SchemaRegistry schemaReg;

TestRevisionRegister testRevisionRegister = new TestRevisionRegister();
Expand Down Expand Up @@ -216,7 +220,8 @@ public void testStopQueryOnNodeStop() throws Exception {
schemaManager,
dataStorageManager,
txManager,
Map::of
Map::of,
clock
);

when(tbl.tableId()).thenReturn(UUID.randomUUID());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
import org.apache.ignite.internal.configuration.testframework.ConfigurationExtension;
import org.apache.ignite.internal.configuration.testframework.InjectConfiguration;
import org.apache.ignite.internal.configuration.testframework.InjectRevisionListenerHolder;
import org.apache.ignite.internal.hlc.HybridClockImpl;
import org.apache.ignite.internal.hlc.HybridClock;
import org.apache.ignite.internal.index.IndexManager;
import org.apache.ignite.internal.metastorage.MetaStorageManager;
import org.apache.ignite.internal.raft.Loza;
Expand Down Expand Up @@ -130,6 +130,9 @@ public class MockedStructuresTest extends IgniteAbstractTest {
@Mock
MetaStorageManager msm;

@Mock
HybridClock clock;

/**
* Revision listener holder. It uses for the test configurations:
* <ul>
Expand Down Expand Up @@ -245,10 +248,13 @@ void before() throws Exception {
schemaManager,
dataStorageManager,
tm,
() -> dataStorageModules.collectSchemasFields(List.of(
RocksDbDataStorageConfigurationSchema.class,
TestDataStorageConfigurationSchema.class
))
() -> dataStorageModules.collectSchemasFields(
List.of(
RocksDbDataStorageConfigurationSchema.class,
TestDataStorageConfigurationSchema.class
)
),
clock
);

queryProc.start();
Expand Down Expand Up @@ -506,7 +512,7 @@ private TableManager createTableManager() {
msm,
schemaManager,
view -> new LocalLogStorageFactory(),
new HybridClockImpl(),
clock,
mock(OutgoingSnapshotsManager.class)
);

Expand Down