From 00a0d4041eeb1b31a244aee97f7fbbd03cf7f591 Mon Sep 17 00:00:00 2001 From: Nikolay Date: Fri, 20 Sep 2024 11:29:09 +0300 Subject: [PATCH 1/8] IGNITE-22732 Transaction aware SQL (#11438) --- .idea/inspectionProfiles/Project_Default.xml | 5 +- .../query/calcite/CalciteQueryProcessor.java | 32 +- .../query/calcite/exec/AbstractIndexScan.java | 9 +- .../calcite/exec/ExchangeServiceImpl.java | 3 +- .../query/calcite/exec/ExecutionContext.java | 102 +- .../calcite/exec/ExecutionServiceImpl.java | 12 +- .../query/calcite/exec/IndexScan.java | 102 +- .../calcite/exec/KeyFilteringCursor.java | 73 + .../calcite/exec/RuntimeSortedIndex.java | 81 +- .../calcite/exec/SortedListRangeCursor.java | 115 ++ .../query/calcite/exec/TableScan.java | 42 +- .../exec/exp/ExpressionFactoryImpl.java | 16 + .../query/calcite/exec/rel/ModifyNode.java | 46 +- .../query/calcite/message/MessageType.java | 5 +- .../calcite/message/QueryStartRequest.java | 48 +- .../query/calcite/message/QueryTxEntry.java | 211 +++ .../query/calcite/prepare/QueryTemplate.java | 29 +- .../query/calcite/schema/CacheIndexImpl.java | 100 +- .../query/calcite/util/Commons.java | 22 + .../query/calcite/QueryChecker.java | 29 +- .../calcite/exec/KeyFilteringCursorTest.java | 160 +++ .../exec/LogicalRelImplementorTest.java | 1 + .../calcite/exec/RuntimeSortedIndexTest.java | 1 + .../exec/rel/AbstractExecutionTest.java | 3 +- .../AbstractBasicIntegrationTest.java | 33 +- ...ractBasicIntegrationTransactionalTest.java | 242 ++++ .../AggregatesIntegrationTest.java | 80 +- ...iteBasicSecondaryIndexIntegrationTest.java | 100 +- .../CorrelatesIntegrationTest.java | 14 +- .../calcite/integration/DataTypesTest.java | 487 ++++--- .../calcite/integration/DateTimeTest.java | 20 +- .../integration/HashSpoolIntegrationTest.java | 16 +- .../IndexMultiRangeScanIntegrationTest.java | 32 +- .../IndexScanlIntegrationTest.java | 61 +- .../integration/JoinIntegrationTest.java | 27 +- .../JoinRehashIntegrationTest.java | 6 +- .../KeepBinaryIntegrationTest.java | 72 +- .../LimitOffsetIntegrationTest.java | 17 +- .../integration/LocalDateTimeSupportTest.java | 190 +-- .../ServerStatisticsIntegrationTest.java | 46 +- .../integration/SetOpIntegrationTest.java | 172 ++- .../SortAggregateIntegrationTest.java | 16 +- .../integration/TableDmlIntegrationTest.java | 124 +- ...FunctionsIntegrationTransactionalTest.java | 46 + .../query/calcite/planner/PlannerTest.java | 3 +- .../tx/SqlTransactionsIsolationTest.java | 1196 +++++++++++++++++ .../SqlTransactionsUnsupportedModesTest.java | 96 ++ .../testsuites/IgniteCalciteTestSuite.java | 7 + .../testsuites/IntegrationTestSuite.java | 2 + .../TransactionConfiguration.java | 33 + .../apache/ignite/internal/IgniteKernal.java | 2 + .../ignite/internal/IgniteNodeAttributes.java | 3 + .../index/sorted/inline/InlineIndexImpl.java | 87 +- .../index/sorted/inline/InlineIndexTree.java | 21 +- .../inline/SortedSegmentedIndexCursor.java | 108 ++ .../cache/ValidationOnNodeJoinUtils.java | 13 + .../cache/persistence/tree/BPlusTree.java | 10 + .../cache/transactions/IgniteTxManager.java | 2 +- .../processors/query/GridQueryProcessor.java | 74 +- .../ignite/internal/util/lang/GridFunc.java | 16 + .../H2TransactionAwareQueriesEnabledTest.java | 80 ++ .../IgniteBinaryCacheQueryTestSuite3.java | 5 +- 62 files changed, 3870 insertions(+), 936 deletions(-) create mode 100644 modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/exec/KeyFilteringCursor.java create mode 100644 modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/exec/SortedListRangeCursor.java create mode 100644 modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/message/QueryTxEntry.java create mode 100644 modules/calcite/src/test/java/org/apache/ignite/internal/processors/query/calcite/exec/KeyFilteringCursorTest.java create mode 100644 modules/calcite/src/test/java/org/apache/ignite/internal/processors/query/calcite/integration/AbstractBasicIntegrationTransactionalTest.java create mode 100644 modules/calcite/src/test/java/org/apache/ignite/internal/processors/query/calcite/integration/UserDefinedFunctionsIntegrationTransactionalTest.java create mode 100644 modules/calcite/src/test/java/org/apache/ignite/internal/processors/tx/SqlTransactionsIsolationTest.java create mode 100644 modules/calcite/src/test/java/org/apache/ignite/internal/processors/tx/SqlTransactionsUnsupportedModesTest.java create mode 100644 modules/core/src/main/java/org/apache/ignite/internal/cache/query/index/sorted/inline/SortedSegmentedIndexCursor.java create mode 100644 modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/H2TransactionAwareQueriesEnabledTest.java diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml index 0af10ada908d7..56dbd67f701bf 100644 --- a/.idea/inspectionProfiles/Project_Default.xml +++ b/.idea/inspectionProfiles/Project_Default.xml @@ -347,6 +347,9 @@ + + @@ -752,7 +755,7 @@ - +