ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From voze...@apache.org
Subject [49/50] [abbrv] ignite git commit: Merge branch 'ignite-2.0' into ignite-4565-ddl
Date Mon, 13 Mar 2017 10:28:23 GMT
Merge branch 'ignite-2.0' into ignite-4565-ddl

# Conflicts:
#	modules/core/src/main/java/org/apache/ignite/internal/processors/query/GridQueryProcessor.java
#	modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/DmlStatementsProcessor.java
#	modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/IgniteH2Indexing.java
#	modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/sql/GridSqlQueryParser.java


Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/8eaff405
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/8eaff405
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/8eaff405

Branch: refs/heads/ignite-4565-ddl
Commit: 8eaff405ea8aa9a94da42c76239cad1ae68c7efc
Parents: ca23e23 d9d6ff0
Author: devozerov <vozerov@gridgain.com>
Authored: Mon Mar 13 13:10:18 2017 +0300
Committer: devozerov <vozerov@gridgain.com>
Committed: Mon Mar 13 13:10:18 2017 +0300

----------------------------------------------------------------------
 DEVNOTES.txt                                    |    2 +-
 RELEASE_NOTES.txt                               |   20 +
 assembly/dependencies-hadoop.xml                |    3 +
 assembly/release-base.xml                       |    5 -
 assembly/release-fabric-base.xml                |    5 +
 assembly/release-sources.xml                    |    3 +-
 config/example-kube.xml                         |   53 +
 doap_Ignite.rdf                                 |    1 -
 examples/pom-standalone-lgpl.xml                |   12 +
 examples/pom-standalone.xml                     |   12 +
 examples/pom.xml                                |   14 +
 .../examples/java8/spark/SharedRDDExample.java  |  110 --
 .../ignite/examples/spark/SharedRDDExample.java |  127 ++
 .../ignite/examples/spark/package-info.java     |   22 +
 .../examples/SharedRDDExampleSelfTest.java      |   36 -
 .../IgniteExamplesJ8SelfTestSuite.java          |    2 -
 .../examples/SharedRDDExampleSelfTest.java      |   36 +
 .../IgniteExamplesSparkSelfTestSuite.java       |   46 +
 modules/clients/src/test/config/jdbc-config.xml |    2 +-
 .../jdbc2/JdbcAbstractDmlStatementSelfTest.java |   49 +-
 .../jdbc2/JdbcInsertStatementSelfTest.java      |   51 +
 .../jdbc2/JdbcMergeStatementSelfTest.java       |   51 +
 .../internal/jdbc2/JdbcStreamingSelfTest.java   |  187 ++
 .../jdbc2/JdbcUpdateStatementSelfTest.java      |   50 +
 .../tcp/redis/RedisProtocolSelfTest.java        |   13 +-
 .../jdbc/suite/IgniteJdbcDriverTestSuite.java   |    1 +
 .../src/main/java/org/apache/ignite/Ignite.java |    1 +
 .../java/org/apache/ignite/IgniteCompute.java   |   44 +-
 .../org/apache/ignite/IgniteJdbcDriver.java     |   30 +
 .../apache/ignite/IgniteSystemProperties.java   |   38 +
 .../apache/ignite/cache/CacheTypeMetadata.java  |    4 +-
 .../ignite/cache/query/SqlFieldsQuery.java      |    4 +-
 .../org/apache/ignite/cache/query/SqlQuery.java |    6 +-
 .../apache/ignite/cache/query/TextQuery.java    |    4 +-
 .../configuration/CacheConfiguration.java       |   66 +-
 .../internal/binary/BinaryClassDescriptor.java  |    9 +-
 .../ignite/internal/binary/BinaryContext.java   |    7 +-
 .../ignite/internal/binary/BinaryTreeMap.java   |    6 +-
 .../ignite/internal/jdbc2/JdbcConnection.java   |   72 +-
 .../internal/jdbc2/JdbcPreparedStatement.java   |   34 +-
 .../ignite/internal/jdbc2/JdbcStatement.java    |   20 +-
 .../jdbc2/JdbcStreamedPreparedStatement.java    |   59 +
 .../apache/ignite/internal/jdbc2/JdbcUtils.java |    4 +-
 .../internal/managers/discovery/DiscoCache.java |  310 ++++
 .../discovery/GridDiscoveryManager.java         |  568 ++----
 .../eventstorage/DiscoveryEventListener.java    |   33 +
 .../eventstorage/GridEventStorageManager.java   |  162 +-
 .../affinity/GridAffinityAssignmentCache.java   |    7 +-
 .../cache/CacheAffinitySharedManager.java       |   35 +-
 .../processors/cache/EntryGetResult.java        |   40 +-
 .../processors/cache/EntryGetWithTtlResult.java |   58 +
 .../processors/cache/GridCacheAdapter.java      |   69 +-
 .../cache/GridCacheAffinityManager.java         |    3 +-
 .../cache/GridCacheClearAllRunnable.java        |    4 +-
 .../processors/cache/GridCacheContext.java      |  122 +-
 .../processors/cache/GridCacheEntryEx.java      |    2 +-
 .../processors/cache/GridCacheMapEntry.java     |   29 +-
 .../GridCachePartitionExchangeManager.java      |   64 +-
 .../processors/cache/GridCacheProcessor.java    |   14 +-
 .../processors/cache/GridCacheSwapManager.java  |    4 +-
 .../processors/cache/IgniteCacheProxy.java      |   10 +-
 .../dht/GridClientPartitionTopology.java        |   20 +-
 .../dht/GridDhtAssignmentFetchFuture.java       |    7 +-
 .../distributed/dht/GridDhtCacheAdapter.java    |    4 +-
 .../cache/distributed/dht/GridDhtGetFuture.java |   24 +-
 .../distributed/dht/GridDhtGetSingleFuture.java |   24 +-
 .../distributed/dht/GridDhtLocalPartition.java  |   10 +-
 .../dht/GridDhtPartitionTopologyImpl.java       |   44 +-
 .../dht/GridPartitionedGetFuture.java           |   19 +-
 .../dht/GridPartitionedSingleGetFuture.java     |    7 +-
 .../dht/atomic/GridDhtAtomicCache.java          |   12 +-
 .../dht/colocated/GridDhtColocatedCache.java    |   15 +-
 .../GridDhtPartitionsExchangeFuture.java        |   33 +-
 .../distributed/near/GridNearGetFuture.java     |    9 +-
 .../cache/distributed/near/GridNearTxLocal.java |   10 +-
 .../local/atomic/GridLocalAtomicCache.java      |   13 +-
 .../cache/query/GridCacheQueryAdapter.java      |    4 +-
 .../cache/query/GridCacheQueryManager.java      |    5 +-
 .../cache/query/GridCacheSqlQuery.java          |  127 +-
 .../transactions/IgniteTxLocalAdapter.java      |   65 +-
 .../IgniteCacheObjectProcessorImpl.java         |    4 +-
 .../closure/GridClosureProcessor.java           |    2 +-
 .../processors/cluster/GridUpdateNotifier.java  |    2 +-
 .../datastructures/DataStructuresProcessor.java |    3 +-
 .../datastructures/GridCacheLockImpl.java       |   17 +-
 .../internal/processors/igfs/IgfsUtils.java     |    6 +-
 .../processors/query/GridQueryIndexing.java     |   66 +-
 .../processors/query/GridQueryProcessor.java    | 1220 ++-----------
 .../processors/query/QueryTypeCandidate.java    |   66 +
 .../internal/processors/query/QueryUtils.java   |  989 ++++++++++
 .../messages/GridQueryNextPageRequest.java      |   29 +-
 .../messages/GridQueryNextPageResponse.java     |   29 +-
 .../query/property/QueryBinaryProperty.java     |    6 +-
 .../handlers/cache/GridCacheCommandHandler.java |   27 +-
 .../redis/GridRedisRestCommandHandler.java      |   36 +
 .../string/GridRedisSetCommandHandler.java      |   43 +-
 .../service/GridServiceProcessor.java           |   21 +-
 .../ignite/internal/util/IgniteUtils.java       |   14 +-
 .../visor/cache/VisorCacheClearTask.java        |   57 +-
 .../internal/visor/query/VisorQueryArgV3.java   |   51 +
 .../internal/visor/query/VisorQueryJob.java     |    6 +-
 .../communication/tcp/TcpCommunicationSpi.java  |   25 +
 .../resources/META-INF/classnames.properties    |    7 +-
 .../internal/GridCacheRecreateLockTest.java     |   78 +
 .../cache/CacheGetEntryAbstractTest.java        |   16 +-
 .../CacheSerializableTransactionsTest.java      |  173 +-
 .../processors/cache/CacheTxFastFinishTest.java |    2 +-
 .../cache/GridCacheAbstractFullApiSelfTest.java |   20 +-
 .../processors/cache/GridCacheTestEntryEx.java  |    2 +-
 ...sExchangeOnDiscoveryHistoryOverflowTest.java |  190 ++
 .../CacheLockReleaseNodeLeaveTest.java          |   64 +-
 .../GridCacheRebalancingSyncSelfTest.java       |   69 +-
 .../IgniteCacheExpiryPolicyAbstractTest.java    |   42 +
 .../GridMarshallerPerformanceTest.java          |    4 +
 .../tcp/TcpCommunicationSpiDropNodesTest.java   |    3 +-
 .../TcpCommunicationSpiFaultyClientTest.java    |    3 +-
 .../junits/common/GridCommonAbstractTest.java   |   77 +
 .../testsuites/IgniteCacheTestSuite5.java       |    3 +
 .../testsuites/IgniteComputeGridTestSuite.java  |    2 +
 modules/docker/1.9.0/Dockerfile                 |   46 +
 modules/docker/1.9.0/run.sh                     |   51 +
 modules/docker/Dockerfile                       |    4 +-
 modules/flink/pom.xml                           |    2 +-
 .../query/h2/opt/GridH2SpatialIndex.java        |   56 +-
 .../query/h2/GridH2IndexingGeoSelfTest.java     |  409 +++--
 .../h2/GridH2IndexingSegmentedGeoSelfTest.java  |   37 +
 .../testsuites/GeoSpatialIndexingTestSuite.java |    2 +
 .../hadoop/shuffle/HadoopShuffleJob.java        |    1 -
 .../cache/query/GridCacheTwoStepQuery.java      |   17 +
 .../query/h2/DmlStatementsProcessor.java        |  272 ++-
 .../processors/query/h2/IgniteH2Indexing.java   |  453 +++--
 .../query/h2/dml/UpdatePlanBuilder.java         |    6 +-
 .../query/h2/opt/DistributedJoinMode.java       |   51 +
 .../query/h2/opt/GridH2CollocationModel.java    |   82 +-
 .../query/h2/opt/GridH2IndexBase.java           |  348 +++-
 .../query/h2/opt/GridH2QueryContext.java        |   84 +-
 .../query/h2/opt/GridH2RowDescriptor.java       |    5 -
 .../query/h2/opt/GridH2ScanIndex.java           |  273 +++
 .../processors/query/h2/opt/GridH2Table.java    |  244 +--
 .../query/h2/opt/GridH2TreeIndex.java           |  135 +-
 .../processors/query/h2/sql/DmlAstUtils.java    |   54 +-
 .../processors/query/h2/sql/GridSqlAlias.java   |   13 +-
 .../processors/query/h2/sql/GridSqlArray.java   |    8 +-
 .../processors/query/h2/sql/GridSqlAst.java     |   61 +
 .../processors/query/h2/sql/GridSqlColumn.java  |   85 +-
 .../processors/query/h2/sql/GridSqlConst.java   |    6 +-
 .../processors/query/h2/sql/GridSqlElement.java |   43 +-
 .../query/h2/sql/GridSqlFunction.java           |   18 +-
 .../processors/query/h2/sql/GridSqlJoin.java    |   35 +-
 .../processors/query/h2/sql/GridSqlKeyword.java |    3 +-
 .../query/h2/sql/GridSqlOperation.java          |    6 +-
 .../query/h2/sql/GridSqlOperationType.java      |    4 +-
 .../query/h2/sql/GridSqlParameter.java          |    4 +-
 .../query/h2/sql/GridSqlPlaceholder.java        |    2 +-
 .../processors/query/h2/sql/GridSqlQuery.java   |   91 +-
 .../query/h2/sql/GridSqlQueryParser.java        |  250 ++-
 .../query/h2/sql/GridSqlQuerySplitter.java      | 1684 +++++++++++++++---
 .../processors/query/h2/sql/GridSqlSelect.java  |  121 +-
 .../query/h2/sql/GridSqlSortColumn.java         |   41 +
 .../query/h2/sql/GridSqlStatement.java          |   11 +-
 .../query/h2/sql/GridSqlSubquery.java           |   31 +-
 .../processors/query/h2/sql/GridSqlTable.java   |   19 +-
 .../processors/query/h2/sql/GridSqlType.java    |    6 +-
 .../processors/query/h2/sql/GridSqlUnion.java   |   66 +-
 .../processors/query/h2/sql/GridSqlValue.java   |   25 -
 .../query/h2/twostep/GridMapQueryExecutor.java  |  321 +++-
 .../query/h2/twostep/GridMergeIndex.java        |  647 +++++--
 .../query/h2/twostep/GridMergeIndexSorted.java  |  380 ++++
 .../h2/twostep/GridMergeIndexUnsorted.java      |  101 +-
 .../query/h2/twostep/GridMergeTable.java        |   70 +-
 .../h2/twostep/GridReduceQueryExecutor.java     |  211 ++-
 .../query/h2/twostep/GridResultPage.java        |   34 +-
 .../h2/twostep/msg/GridH2IndexRangeRequest.java |   60 +-
 .../twostep/msg/GridH2IndexRangeResponse.java   |   62 +-
 .../h2/twostep/msg/GridH2QueryRequest.java      |   19 +-
 .../IgniteCacheAbstractFieldsQuerySelfTest.java |    2 +-
 ...niteCacheAbstractInsertSqlQuerySelfTest.java |    6 +-
 .../cache/IgniteCacheAbstractQuerySelfTest.java |   10 +-
 .../IgniteCacheInsertSqlQuerySelfTest.java      |   14 +
 .../cache/IgniteCacheQueryLoadSelfTest.java     |    4 +-
 .../IgniteCacheUpdateSqlQuerySelfTest.java      |    1 +
 .../query/IgniteSqlSegmentedIndexSelfTest.java  |  263 +++
 .../query/IgniteSqlSplitterSelfTest.java        |  331 +++-
 .../h2/GridIndexingSpiAbstractSelfTest.java     |   33 +-
 .../h2/sql/AbstractH2CompareQueryTest.java      |   21 +-
 .../query/h2/sql/GridQueryParsingTest.java      |   72 +-
 .../query/h2/sql/H2CompareBigQueryTest.java     |   58 +-
 .../FetchingQueryCursorStressTest.java          |  277 +++
 .../IgniteCacheQuerySelfTestSuite.java          |    4 +
 .../processors/query/h2/sql/bigQuery.sql        |   36 +-
 modules/kubernetes/config/Dockerfile            |   17 +
 .../kubernetes/config/ignite-deployment.yaml    |   15 +
 modules/kubernetes/config/ignite-service.yaml   |   15 +
 .../cpp/common/project/vs/common.vcxproj        |    1 -
 .../common/project/vs/common.vcxproj.filters    |    6 -
 .../platforms/cpp/common/project/vs/targetver.h |   25 -
 modules/platforms/cpp/core-test/Makefile.am     |    1 +
 .../cpp/core-test/config/cache-store.xml        |   71 +
 .../cpp/core-test/project/vs/core-test.vcxproj  |    5 +
 .../project/vs/core-test.vcxproj.filters        |    9 +
 .../src/binary_identity_resolver_test.cpp       |    2 +-
 .../src/binary_reader_writer_raw_test.cpp       |    2 +-
 .../core-test/src/binary_reader_writer_test.cpp |    2 +-
 .../cpp/core-test/src/binary_session_test.cpp   |    2 +-
 .../cpp/core-test/src/cache_query_test.cpp      |    2 +-
 .../cpp/core-test/src/cache_store_test.cpp      |  151 ++
 .../cpp/core-test/src/continuous_query_test.cpp |    2 +-
 .../cpp/core-test/src/handle_registry_test.cpp  |    2 +-
 .../cpp/core-test/src/ignite_error_test.cpp     |    2 +-
 .../cpp/core-test/src/ignition_test.cpp         |    2 +-
 .../cpp/core-test/src/interop_memory_test.cpp   |    2 +-
 .../cpp/core-test/src/reference_test.cpp        |    2 +-
 .../platforms/cpp/core-test/src/test_utils.cpp  |    7 +
 .../cpp/core-test/src/transactions_test.cpp     |    2 +-
 .../cpp/core/include/ignite/cache/cache.h       |   60 +-
 .../cache/query/continuous/continuous_query.h   |    2 +-
 .../core/include/ignite/impl/cache/cache_impl.h |   19 +
 .../ignite/impl/interop/interop_target.h        |   25 +
 .../cpp/core/src/impl/cache/cache_impl.cpp      |   48 +
 .../core/src/impl/interop/interop_target.cpp    |   36 +-
 .../cpp/jni/include/ignite/jni/utils.h          |    9 +
 .../platforms/cpp/jni/os/linux/src/utils.cpp    |    6 -
 modules/platforms/cpp/jni/os/win/src/utils.cpp  |    6 -
 .../platforms/cpp/jni/project/vs/jni.vcxproj    |    1 -
 .../cpp/jni/project/vs/jni.vcxproj.filters      |    3 -
 .../platforms/cpp/jni/project/vs/targetver.h    |   25 -
 .../Properties/AssemblyInfo.cs                  |    2 +-
 .../Properties/AssemblyInfo.cs                  |    2 +-
 .../Properties/AssemblyInfo.cs                  |    2 +-
 .../Properties/AssemblyInfo.cs                  |    2 +-
 .../Properties/AssemblyInfo.cs                  |    2 +-
 .../Properties/AssemblyInfo.cs                  |    2 +-
 modules/spark-2.10/pom.xml                      |   54 +
 modules/spark/pom.xml                           |  183 +-
 .../org/apache/ignite/spark/IgniteContext.scala |   22 +-
 .../spark/JavaEmbeddedIgniteRDDSelfTest.java    |   10 +-
 .../spark/JavaStandaloneIgniteRDDSelfTest.java  |   22 +-
 .../ant/beautifier/GridJavadocAntTask.java      |    1 +
 modules/web-console/backend/app/agent.js        |   36 +
 modules/web-console/backend/app/browser.js      |   28 +
 modules/web-console/backend/app/settings.js     |    8 +-
 modules/web-console/backend/index.js            |   10 -
 modules/web-console/frontend/.eslintrc          |    1 +
 modules/web-console/frontend/.gitignore         |    1 +
 modules/web-console/frontend/app/app.config.js  |   12 +-
 modules/web-console/frontend/app/app.js         |    7 +-
 .../activities-user-dialog.jade                 |   36 -
 .../activities-user-dialog.tpl.pug              |   36 +
 .../components/activities-user-dialog/index.js  |    2 +-
 .../form-field-datepicker.jade                  |   55 -
 .../form-field-datepicker.pug                   |   55 +
 .../list-of-registered-users/index.js           |    2 +-
 .../list-of-registered-users.controller.js      |   11 +-
 .../list-of-registered-users.jade               |   58 -
 .../list-of-registered-users.tpl.pug            |   58 +
 .../ui-grid-header/ui-grid-header.jade          |   27 -
 .../ui-grid-header/ui-grid-header.scss          |    1 +
 .../ui-grid-header/ui-grid-header.tpl.pug       |   27 +
 .../ui-grid-settings/ui-grid-settings.jade      |   33 -
 .../ui-grid-settings/ui-grid-settings.pug       |   33 +
 .../app/directives/centered/centered.css        |   37 -
 .../directives/centered/centered.directive.js   |    2 +-
 .../app/directives/centered/centered.scss       |   37 +
 .../information/information.directive.js        |    4 +-
 .../app/directives/information/information.jade |   20 -
 .../app/directives/information/information.pug  |   20 +
 .../ui-ace-docker/ui-ace-docker.directive.js    |    4 +-
 .../directives/ui-ace-docker/ui-ace-docker.jade |   31 -
 .../directives/ui-ace-docker/ui-ace-docker.pug  |   31 +
 .../ui-ace-java/ui-ace-java.directive.js        |    4 +-
 .../app/directives/ui-ace-java/ui-ace-java.jade |   22 -
 .../app/directives/ui-ace-java/ui-ace-java.pug  |   22 +
 .../ui-ace-pojos/ui-ace-pojos.directive.js      |    4 +-
 .../directives/ui-ace-pojos/ui-ace-pojos.jade   |   40 -
 .../directives/ui-ace-pojos/ui-ace-pojos.pug    |   40 +
 .../ui-ace-pom/ui-ace-pom.directive.js          |    4 +-
 .../app/directives/ui-ace-pom/ui-ace-pom.jade   |   17 -
 .../app/directives/ui-ace-pom/ui-ace-pom.pug    |   17 +
 .../ui-ace-sharp/ui-ace-sharp.directive.js      |    4 +-
 .../directives/ui-ace-sharp/ui-ace-sharp.jade   |   22 -
 .../directives/ui-ace-sharp/ui-ace-sharp.pug    |   22 +
 .../ui-ace-spring/ui-ace-spring.directive.js    |    4 +-
 .../directives/ui-ace-spring/ui-ace-spring.jade |   17 -
 .../directives/ui-ace-spring/ui-ace-spring.pug  |   17 +
 .../frontend/app/helpers/jade/form.jade         |   28 -
 .../frontend/app/helpers/jade/form.pug          |   28 +
 .../helpers/jade/form/form-field-checkbox.jade  |   38 -
 .../helpers/jade/form/form-field-checkbox.pug   |   38 +
 .../helpers/jade/form/form-field-datalist.jade  |   51 -
 .../helpers/jade/form/form-field-datalist.pug   |   51 +
 .../app/helpers/jade/form/form-field-down.jade  |   18 -
 .../app/helpers/jade/form/form-field-down.pug   |   18 +
 .../helpers/jade/form/form-field-dropdown.jade  |   51 -
 .../helpers/jade/form/form-field-dropdown.pug   |   51 +
 .../helpers/jade/form/form-field-feedback.jade  |   32 -
 .../helpers/jade/form/form-field-feedback.pug   |   32 +
 .../app/helpers/jade/form/form-field-label.jade |   23 -
 .../app/helpers/jade/form/form-field-label.pug  |   23 +
 .../helpers/jade/form/form-field-number.jade    |   53 -
 .../app/helpers/jade/form/form-field-number.pug |   53 +
 .../helpers/jade/form/form-field-password.jade  |   47 -
 .../helpers/jade/form/form-field-password.pug   |   47 +
 .../app/helpers/jade/form/form-field-text.jade  |   64 -
 .../app/helpers/jade/form/form-field-text.pug   |   64 +
 .../app/helpers/jade/form/form-field-up.jade    |   18 -
 .../app/helpers/jade/form/form-field-up.pug     |   18 +
 .../app/helpers/jade/form/form-group.jade       |   23 -
 .../app/helpers/jade/form/form-group.pug        |   23 +
 .../frontend/app/helpers/jade/mixins.jade       |  609 -------
 .../frontend/app/helpers/jade/mixins.pug        |  609 +++++++
 .../frontend/app/modules/agent/agent.module.js  |    4 +-
 .../modules/branding/header-logo.directive.js   |    4 +-
 .../app/modules/branding/header-logo.jade       |   18 -
 .../app/modules/branding/header-logo.pug        |   18 +
 .../branding/powered-by-apache.directive.js     |    4 +-
 .../app/modules/branding/powered-by-apache.jade |   18 -
 .../app/modules/branding/powered-by-apache.pug  |   18 +
 .../frontend/app/modules/demo/Demo.module.js    |    3 +-
 .../app/modules/dialog/dialog.factory.js        |    2 +-
 .../frontend/app/modules/dialog/dialog.jade     |   26 -
 .../frontend/app/modules/dialog/dialog.tpl.pug  |   26 +
 .../getting-started/GettingStarted.provider.js  |    3 +-
 .../frontend/app/modules/loading/loading.css    |   73 -
 .../app/modules/loading/loading.directive.js    |    8 +-
 .../frontend/app/modules/loading/loading.jade   |   23 -
 .../frontend/app/modules/loading/loading.pug    |   23 +
 .../frontend/app/modules/loading/loading.scss   |   73 +
 .../frontend/app/modules/nodes/Nodes.service.js |    4 +-
 .../app/modules/nodes/nodes-dialog.jade         |   35 -
 .../app/modules/nodes/nodes-dialog.tpl.pug      |   35 +
 .../app/modules/sql/notebook.controller.js      |    4 +-
 .../frontend/app/modules/sql/sql.controller.js  |   14 +-
 .../frontend/app/modules/sql/sql.module.js      |   15 +-
 .../frontend/app/modules/states/admin.state.js  |    4 +-
 .../app/modules/states/configuration.state.js   |   23 +-
 .../states/configuration/caches/affinity.jade   |   82 -
 .../states/configuration/caches/affinity.pug    |   82 +
 .../configuration/caches/client-near-cache.jade |   50 -
 .../configuration/caches/client-near-cache.pug  |   50 +
 .../configuration/caches/concurrency.jade       |   65 -
 .../states/configuration/caches/concurrency.pug |   65 +
 .../states/configuration/caches/general.jade    |   69 -
 .../states/configuration/caches/general.pug     |   69 +
 .../states/configuration/caches/memory.jade     |  109 --
 .../states/configuration/caches/memory.pug      |  108 ++
 .../configuration/caches/near-cache-client.jade |   51 -
 .../configuration/caches/near-cache-client.pug  |   51 +
 .../configuration/caches/near-cache-server.jade |   52 -
 .../configuration/caches/near-cache-server.pug  |   52 +
 .../configuration/caches/node-filter.jade       |   59 -
 .../states/configuration/caches/node-filter.pug |   59 +
 .../states/configuration/caches/query.jade      |  114 --
 .../states/configuration/caches/query.pug       |  114 ++
 .../states/configuration/caches/rebalance.jade  |   66 -
 .../states/configuration/caches/rebalance.pug   |   66 +
 .../states/configuration/caches/statistics.jade |   39 -
 .../states/configuration/caches/statistics.pug  |   39 +
 .../states/configuration/caches/store.jade      |  250 ---
 .../states/configuration/caches/store.pug       |  250 +++
 .../states/configuration/clusters/atomic.jade   |   54 -
 .../states/configuration/clusters/atomic.pug    |   54 +
 .../configuration/clusters/attributes.jade      |   57 -
 .../configuration/clusters/attributes.pug       |   57 +
 .../states/configuration/clusters/binary.jade   |   77 -
 .../states/configuration/clusters/binary.pug    |   77 +
 .../configuration/clusters/cache-key-cfg.jade   |   50 -
 .../configuration/clusters/cache-key-cfg.pug    |   50 +
 .../configuration/clusters/checkpoint.jade      |   86 -
 .../configuration/clusters/checkpoint.pug       |   86 +
 .../configuration/clusters/checkpoint/fs.jade   |   66 -
 .../configuration/clusters/checkpoint/fs.pug    |   66 +
 .../configuration/clusters/checkpoint/jdbc.jade |   48 -
 .../configuration/clusters/checkpoint/jdbc.pug  |   48 +
 .../configuration/clusters/checkpoint/s3.jade   |  178 --
 .../configuration/clusters/checkpoint/s3.pug    |  178 ++
 .../configuration/clusters/collision.jade       |   63 -
 .../states/configuration/clusters/collision.pug |   63 +
 .../clusters/collision/custom.jade              |   24 -
 .../configuration/clusters/collision/custom.pug |   24 +
 .../clusters/collision/fifo-queue.jade          |   27 -
 .../clusters/collision/fifo-queue.pug           |   27 +
 .../clusters/collision/job-stealing.jade        |   63 -
 .../clusters/collision/job-stealing.pug         |   63 +
 .../clusters/collision/priority-queue.jade      |   42 -
 .../clusters/collision/priority-queue.pug       |   42 +
 .../configuration/clusters/communication.jade   |  100 --
 .../configuration/clusters/communication.pug    |  100 ++
 .../configuration/clusters/connector.jade       |  104 --
 .../states/configuration/clusters/connector.pug |  104 ++
 .../configuration/clusters/deployment.jade      |  237 ---
 .../configuration/clusters/deployment.pug       |  237 +++
 .../configuration/clusters/discovery.jade       |   88 -
 .../states/configuration/clusters/discovery.pug |   88 +
 .../states/configuration/clusters/events.jade   |   68 -
 .../states/configuration/clusters/events.pug    |   68 +
 .../states/configuration/clusters/failover.jade |   73 -
 .../states/configuration/clusters/failover.pug  |   73 +
 .../states/configuration/clusters/general.jade  |   76 -
 .../states/configuration/clusters/general.pug   |   76 +
 .../clusters/general/discovery/cloud.jade       |  134 --
 .../clusters/general/discovery/cloud.pug        |  134 ++
 .../clusters/general/discovery/google.jade      |   38 -
 .../clusters/general/discovery/google.pug       |   38 +
 .../clusters/general/discovery/jdbc.jade        |   31 -
 .../clusters/general/discovery/jdbc.pug         |   31 +
 .../clusters/general/discovery/multicast.jade   |   99 -
 .../clusters/general/discovery/multicast.pug    |   99 +
 .../clusters/general/discovery/s3.jade          |   27 -
 .../clusters/general/discovery/s3.pug           |   27 +
 .../clusters/general/discovery/shared.jade      |   23 -
 .../clusters/general/discovery/shared.pug       |   23 +
 .../clusters/general/discovery/vm.jade          |   79 -
 .../clusters/general/discovery/vm.pug           |   79 +
 .../clusters/general/discovery/zookeeper.jade   |   85 -
 .../clusters/general/discovery/zookeeper.pug    |   85 +
 .../bounded-exponential-backoff.jade            |   27 -
 .../retrypolicy/bounded-exponential-backoff.pug |   27 +
 .../discovery/zookeeper/retrypolicy/custom.jade |   24 -
 .../discovery/zookeeper/retrypolicy/custom.pug  |   24 +
 .../retrypolicy/exponential-backoff.jade        |   27 -
 .../retrypolicy/exponential-backoff.pug         |   27 +
 .../zookeeper/retrypolicy/forever.jade          |   22 -
 .../discovery/zookeeper/retrypolicy/forever.pug |   22 +
 .../zookeeper/retrypolicy/n-times.jade          |   25 -
 .../discovery/zookeeper/retrypolicy/n-times.pug |   25 +
 .../zookeeper/retrypolicy/one-time.jade         |   23 -
 .../zookeeper/retrypolicy/one-time.pug          |   23 +
 .../zookeeper/retrypolicy/until-elapsed.jade    |   25 -
 .../zookeeper/retrypolicy/until-elapsed.pug     |   25 +
 .../states/configuration/clusters/igfs.jade     |   38 -
 .../states/configuration/clusters/igfs.pug      |   38 +
 .../configuration/clusters/load-balancing.jade  |  107 --
 .../configuration/clusters/load-balancing.pug   |  107 ++
 .../states/configuration/clusters/logger.jade   |   66 -
 .../states/configuration/clusters/logger.pug    |   66 +
 .../configuration/clusters/logger/custom.jade   |   25 -
 .../configuration/clusters/logger/custom.pug    |   25 +
 .../configuration/clusters/logger/log4j.jade    |   50 -
 .../configuration/clusters/logger/log4j.pug     |   50 +
 .../configuration/clusters/logger/log4j2.jade   |   39 -
 .../configuration/clusters/logger/log4j2.pug    |   39 +
 .../configuration/clusters/marshaller.jade      |   76 -
 .../configuration/clusters/marshaller.pug       |   76 +
 .../states/configuration/clusters/metrics.jade  |   51 -
 .../states/configuration/clusters/metrics.pug   |   51 +
 .../states/configuration/clusters/odbc.jade     |   48 -
 .../states/configuration/clusters/odbc.pug      |   48 +
 .../states/configuration/clusters/ssl.jade      |  110 --
 .../states/configuration/clusters/ssl.pug       |  110 ++
 .../states/configuration/clusters/swap.jade     |   72 -
 .../states/configuration/clusters/swap.pug      |   72 +
 .../states/configuration/clusters/thread.jade   |   48 -
 .../states/configuration/clusters/thread.pug    |   48 +
 .../states/configuration/clusters/time.jade     |   47 -
 .../states/configuration/clusters/time.pug      |   47 +
 .../configuration/clusters/transactions.jade    |   69 -
 .../configuration/clusters/transactions.pug     |   69 +
 .../states/configuration/domains/general.jade   |   52 -
 .../states/configuration/domains/general.pug    |   52 +
 .../states/configuration/domains/query.jade     |  172 --
 .../states/configuration/domains/query.pug      |  172 ++
 .../states/configuration/domains/store.jade     |  127 --
 .../states/configuration/domains/store.pug      |  127 ++
 .../modules/states/configuration/igfs/dual.jade |   42 -
 .../modules/states/configuration/igfs/dual.pug  |   42 +
 .../states/configuration/igfs/fragmentizer.jade |   43 -
 .../states/configuration/igfs/fragmentizer.pug  |   43 +
 .../states/configuration/igfs/general.jade      |   57 -
 .../states/configuration/igfs/general.pug       |   57 +
 .../modules/states/configuration/igfs/ipc.jade  |   60 -
 .../modules/states/configuration/igfs/ipc.pug   |   60 +
 .../modules/states/configuration/igfs/misc.jade |  108 --
 .../modules/states/configuration/igfs/misc.pug  |  108 ++
 .../states/configuration/igfs/secondary.jade    |   45 -
 .../states/configuration/igfs/secondary.pug     |   45 +
 .../configuration/summary/summary.controller.js |    5 +
 .../frontend/app/modules/states/errors.state.js |    4 +-
 .../app/modules/states/password.state.js        |    6 +-
 .../app/modules/states/profile.state.js         |    4 +-
 .../frontend/app/modules/states/signin.state.js |    2 +-
 .../frontend/app/services/Clone.service.js      |    4 +-
 .../frontend/app/services/Confirm.service.js    |    4 +-
 .../app/services/ConfirmBatch.service.js        |    4 +-
 .../frontend/controllers/caches-controller.js   |    4 +-
 .../frontend/controllers/domains-controller.js  |    4 +-
 .../frontend/gulpfile.babel.js/paths.js         |   28 +-
 .../frontend/gulpfile.babel.js/tasks/build.js   |    2 +-
 .../frontend/gulpfile.babel.js/tasks/bundle.js  |    8 +-
 .../frontend/gulpfile.babel.js/tasks/jade.js    |   49 -
 .../frontend/gulpfile.babel.js/tasks/watch.js   |    5 +-
 .../gulpfile.babel.js/webpack/common.js         |  292 +--
 .../webpack/environments/development.js         |   90 +-
 .../webpack/environments/production.js          |   41 +-
 .../webpack/environments/test.js                |   52 +-
 .../frontend/gulpfile.babel.js/webpack/index.js |    4 +-
 modules/web-console/frontend/package.json       |   60 +-
 .../frontend/test/e2e/exampe.test.js            |    4 +-
 .../frontend/test/karma.conf.babel.js           |    7 +-
 .../frontend/test/protractor.conf.js            |   16 +-
 .../frontend/test/unit/JavaTransformer.test.js  |    2 +-
 .../frontend/test/unit/JavaTypes.test.js        |  137 +-
 .../frontend/test/unit/SharpTransformer.test.js |    2 +-
 .../test/unit/SpringTransformer.test.js         |    2 +-
 .../frontend/test/unit/SqlTypes.test.js         |    7 +-
 .../frontend/test/unit/UserAuth.test.js         |    4 +-
 .../frontend/test/unit/Version.test.js          |    1 +
 .../test/unit/defaultName.filter.test.js        |   27 +-
 modules/web-console/frontend/views/403.jade     |   22 -
 modules/web-console/frontend/views/403.pug      |   22 +
 modules/web-console/frontend/views/404.jade     |   22 -
 modules/web-console/frontend/views/404.pug      |   22 +
 modules/web-console/frontend/views/base.jade    |   22 -
 modules/web-console/frontend/views/base.pug     |   22 +
 .../frontend/views/configuration/caches.jade    |   55 -
 .../frontend/views/configuration/caches.tpl.pug |   55 +
 .../frontend/views/configuration/clusters.jade  |   68 -
 .../views/configuration/clusters.tpl.pug        |   68 +
 .../views/configuration/domains-import.jade     |  170 --
 .../views/configuration/domains-import.tpl.pug  |  170 ++
 .../frontend/views/configuration/domains.jade   |   66 -
 .../views/configuration/domains.tpl.pug         |   66 +
 .../frontend/views/configuration/igfs.jade      |   51 -
 .../frontend/views/configuration/igfs.tpl.pug   |   51 +
 .../frontend/views/configuration/sidebar.jade   |   29 -
 .../views/configuration/sidebar.tpl.pug         |   29 +
 .../summary-project-structure.jade              |   27 -
 .../summary-project-structure.tpl.pug           |   28 +
 .../views/configuration/summary-tabs.jade       |   25 -
 .../views/configuration/summary-tabs.pug        |   25 +
 .../frontend/views/configuration/summary.jade   |   90 -
 .../views/configuration/summary.tpl.pug         |   90 +
 .../frontend/views/includes/footer.jade         |   23 -
 .../frontend/views/includes/footer.pug          |   23 +
 .../frontend/views/includes/header.jade         |   52 -
 .../frontend/views/includes/header.pug          |   52 +
 modules/web-console/frontend/views/index.jade   |   47 -
 modules/web-console/frontend/views/index.pug    |   47 +
 modules/web-console/frontend/views/reset.jade   |   48 -
 .../web-console/frontend/views/reset.tpl.pug    |   48 +
 .../frontend/views/settings/admin.jade          |   25 -
 .../frontend/views/settings/admin.tpl.pug       |   25 +
 .../frontend/views/settings/profile.jade        |   76 -
 .../frontend/views/settings/profile.tpl.pug     |   76 +
 modules/web-console/frontend/views/signin.jade  |  163 --
 .../web-console/frontend/views/signin.tpl.pug   |  163 ++
 .../frontend/views/sql/cache-metadata.jade      |   40 -
 .../frontend/views/sql/cache-metadata.tpl.pug   |   40 +
 .../frontend/views/sql/chart-settings.jade      |   40 -
 .../frontend/views/sql/chart-settings.tpl.pug   |   40 +
 .../frontend/views/sql/notebook-new.jade        |   33 -
 .../frontend/views/sql/notebook-new.tpl.pug     |   33 +
 .../frontend/views/sql/paragraph-rate.jade      |   31 -
 .../frontend/views/sql/paragraph-rate.tpl.pug   |   31 +
 modules/web-console/frontend/views/sql/sql.jade |  278 ---
 .../web-console/frontend/views/sql/sql.tpl.pug  |  278 +++
 .../views/templates/agent-download.jade         |   50 -
 .../views/templates/agent-download.tpl.pug      |   50 +
 .../frontend/views/templates/alert.jade         |   21 -
 .../frontend/views/templates/alert.tpl.pug      |   21 +
 .../frontend/views/templates/batch-confirm.jade |   34 -
 .../views/templates/batch-confirm.tpl.pug       |   34 +
 .../frontend/views/templates/clone.jade         |   39 -
 .../frontend/views/templates/clone.tpl.pug      |   39 +
 .../frontend/views/templates/confirm.jade       |   33 -
 .../frontend/views/templates/confirm.tpl.pug    |   33 +
 .../frontend/views/templates/demo-info.jade     |   47 -
 .../frontend/views/templates/demo-info.tpl.pug  |   47 +
 .../frontend/views/templates/dropdown.jade      |   24 -
 .../frontend/views/templates/dropdown.tpl.pug   |   24 +
 .../views/templates/getting-started.jade        |   34 -
 .../views/templates/getting-started.tpl.pug     |   34 +
 .../frontend/views/templates/message.jade       |   28 -
 .../frontend/views/templates/message.tpl.pug    |   28 +
 .../frontend/views/templates/pagination.jade    |   32 -
 .../frontend/views/templates/select.jade        |   26 -
 .../frontend/views/templates/select.tpl.pug     |   26 +
 .../views/templates/validation-error.jade       |   25 -
 .../views/templates/validation-error.tpl.pug    |   25 +
 .../demo/service/DemoCachesLoadService.java     |   26 +
 modules/yardstick/config/ignite-base-config.xml |   25 +
 .../yardstick/cache/IgniteGetAllBenchmark.java  |   42 +
 .../cache/IgniteGetAllOffHeapBenchmark.java     |   30 +
 .../yardstick/cache/IgniteGetBenchmark.java     |   35 +
 .../cache/IgnitePutAllOffHeapBenchmark.java     |   30 +
 .../cache/IgnitePutAllTxOffHeapBenchmark.java   |   30 +
 .../IgnitePutOffHeapIndexedValue8Benchmark.java |   30 +
 .../IgnitePutRandomValueSizeBenchmark.java      |   41 +
 modules/zeromq/README.txt                       |   37 +
 modules/zeromq/licenses/apache-2.0.txt          |  202 +++
 modules/zeromq/pom.xml                          |   75 +
 .../stream/zeromq/IgniteZeroMqStreamer.java     |  146 ++
 .../ignite/stream/zeromq/ZeroMqTypeSocket.java  |   56 +
 .../ignite/stream/zeromq/package-info.java      |   21 +
 .../stream/zeromq/IgniteZeroMqStreamerTest.java |  235 +++
 .../zeromq/IgniteZeroMqStreamerTestSuite.java   |   37 +
 .../ZeroMqStringSingleTupleExtractor.java       |   46 +
 .../ignite/stream/zeromq/package-info.java      |   21 +
 parent/pom.xml                                  |    6 +-
 pom.xml                                         |    1 +
 599 files changed, 21889 insertions(+), 13121 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/8eaff405/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/ignite/blob/8eaff405/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryManager.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/ignite/blob/8eaff405/modules/core/src/main/java/org/apache/ignite/internal/processors/query/GridQueryIndexing.java
----------------------------------------------------------------------
diff --cc modules/core/src/main/java/org/apache/ignite/internal/processors/query/GridQueryIndexing.java
index fc8e31f,4c32776..299df34
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/query/GridQueryIndexing.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/query/GridQueryIndexing.java
@@@ -230,9 -237,17 +237,17 @@@ public interface GridQueryIndexing 
       * @param sql Query.
       * @return {@link PreparedStatement} from underlying engine to supply metadata to Prepared - most likely H2.
       */
 -    public PreparedStatement prepareNativeStatement(String schema, String sql) throws SQLException;
 +    public PreparedStatement prepareNativeStatement(String space, String sql) throws SQLException;
  
      /**
+      * Gets space name from database schema.
+      *
+      * @param schemaName Schema name. Could not be null. Could be empty.
+      * @return Space name. Could be null.
+      */
+     public String space(String schemaName);
+ 
+     /**
       * Collect queries that already running more than specified duration.
       *
       * @param duration Duration to check.

http://git-wip-us.apache.org/repos/asf/ignite/blob/8eaff405/modules/core/src/main/java/org/apache/ignite/internal/processors/query/GridQueryProcessor.java
----------------------------------------------------------------------
diff --cc modules/core/src/main/java/org/apache/ignite/internal/processors/query/GridQueryProcessor.java
index d9e7048,219373c..db31d1d
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/query/GridQueryProcessor.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/query/GridQueryProcessor.java
@@@ -17,24 -17,15 +17,22 @@@
  
  package org.apache.ignite.internal.processors.query;
  
 +import java.lang.reflect.Method;
 +import java.math.BigDecimal;
 +import java.sql.PreparedStatement;
 +import java.sql.SQLException;
 +import java.sql.Time;
 +import java.sql.Timestamp;
+ import java.sql.PreparedStatement;
+ import java.sql.SQLException;
  import java.util.ArrayList;
  import java.util.Collection;
  import java.util.Collections;
- import java.util.HashSet;
  import java.util.Iterator;
- import java.util.LinkedHashMap;
  import java.util.List;
  import java.util.Map;
- import java.util.Set;
- import java.util.UUID;
  import java.util.concurrent.ConcurrentMap;
 +import java.util.concurrent.TimeUnit;
  import javax.cache.Cache;
  import javax.cache.CacheException;
  import org.apache.ignite.IgniteCheckedException;
@@@ -51,11 -40,8 +47,10 @@@ import org.apache.ignite.cache.query.Sq
  import org.apache.ignite.configuration.CacheConfiguration;
  import org.apache.ignite.events.CacheQueryExecutedEvent;
  import org.apache.ignite.internal.GridKernalContext;
 +import org.apache.ignite.internal.IgniteInternalFuture;
 +import org.apache.ignite.internal.binary.BinaryMarshaller;
  import org.apache.ignite.internal.processors.GridProcessorAdapter;
  import org.apache.ignite.internal.processors.affinity.AffinityTopologyVersion;
- import org.apache.ignite.internal.processors.cache.CacheEntryImpl;
  import org.apache.ignite.internal.processors.cache.CacheObject;
  import org.apache.ignite.internal.processors.cache.CacheObjectContext;
  import org.apache.ignite.internal.processors.cache.GridCacheContext;
@@@ -184,22 -128,7 +151,12 @@@ public class GridQueryProcessor extend
          }, QRY_DETAIL_METRICS_EVICTION_FREQ, QRY_DETAIL_METRICS_EVICTION_FREQ);
      }
  
 +    /** {@inheritDoc} */
 +    @Override public void onKernalStart() throws IgniteCheckedException {
 +        idxHnd.onKernalStart();
 +    }
 +
      /**
-      * @param ccfg Cache configuration.
-      * @return {@code true} If query index must be enabled for this cache.
-      */
-     public static boolean isEnabled(CacheConfiguration<?,?> ccfg) {
-         return !F.isEmpty(ccfg.getIndexedTypes()) ||
-             !F.isEmpty(ccfg.getTypeMetadata()) ||
-             !F.isEmpty(ccfg.getQueryEntities());
-     }
- 
-     /**
       * @return {@code true} If indexing module is in classpath and successfully initialized.
       */
      public boolean moduleEnabled() {
@@@ -220,236 -139,53 +177,57 @@@
       * @param cctx Cache context.
       * @throws IgniteCheckedException If failed.
       */
+     @SuppressWarnings("deprecation")
      private void initializeCache(GridCacheContext<?, ?> cctx) throws IgniteCheckedException {
-         CacheConfiguration<?,?> ccfg = cctx.config();
- 
-         idx.registerCache(cctx, cctx.config());
- 
-         try {
-             Collection<QueryTypeDescriptorImpl> typeDescs = new ArrayList<>();
- 
-             List<Class<?>> mustDeserializeClss = null;
- 
-             boolean binaryEnabled = ctx.cacheObjects().isBinaryEnabled(ccfg);
- 
-             CacheObjectContext coCtx = binaryEnabled ? ctx.cacheObjects().contextForCache(ccfg) : null;
- 
-             if (!F.isEmpty(ccfg.getQueryEntities())) {
-                 for (QueryEntity qryEntity : ccfg.getQueryEntities()) {
-                     if (F.isEmpty(qryEntity.getValueType()))
-                         throw new IgniteCheckedException("Value type is not set: " + qryEntity);
- 
-                     QueryTypeDescriptorImpl desc = new QueryTypeDescriptorImpl(cctx.name());
- 
-                     // Key and value classes still can be available if they are primitive or JDK part.
-                     // We need that to set correct types for _key and _val columns.
-                     Class<?> keyCls = U.classForName(qryEntity.getKeyType(), null);
-                     Class<?> valCls = U.classForName(qryEntity.getValueType(), null);
- 
-                     // If local node has the classes and they are externalizable, we must use reflection properties.
-                     boolean keyMustDeserialize = mustDeserializeBinary(keyCls);
-                     boolean valMustDeserialize = mustDeserializeBinary(valCls);
- 
-                     boolean keyOrValMustDeserialize = keyMustDeserialize || valMustDeserialize;
- 
-                     if (keyCls == null)
-                         keyCls = Object.class;
- 
-                     String simpleValType = ((valCls == null) ? typeName(qryEntity.getValueType()) : typeName(valCls));
- 
-                     desc.name(simpleValType);
+         String space = cctx.name();
  
-                     desc.tableName(qryEntity.getTableName());
- 
-                     if (binaryEnabled && !keyOrValMustDeserialize) {
-                         // Safe to check null.
-                         if (SQL_TYPES.contains(valCls))
-                             desc.valueClass(valCls);
-                         else
-                             desc.valueClass(Object.class);
- 
-                         if (SQL_TYPES.contains(keyCls))
-                             desc.keyClass(keyCls);
-                         else
-                             desc.keyClass(Object.class);
-                     }
-                     else {
-                         if (keyCls == null)
-                             throw new IgniteCheckedException("Failed to find key class in the node classpath " +
-                                 "(use default marshaller to enable binary objects): " + qryEntity.getKeyType());
- 
-                         if (valCls == null)
-                             throw new IgniteCheckedException("Failed to find value class in the node classpath " +
-                                 "(use default marshaller to enable binary objects) : " + qryEntity.getValueType());
- 
-                         desc.valueClass(valCls);
-                         desc.keyClass(keyCls);
-                     }
- 
-                     desc.keyTypeName(qryEntity.getKeyType());
-                     desc.valueTypeName(qryEntity.getValueType());
- 
-                     if (binaryEnabled && keyOrValMustDeserialize) {
-                         if (mustDeserializeClss == null)
-                             mustDeserializeClss = new ArrayList<>();
- 
-                         if (keyMustDeserialize)
-                             mustDeserializeClss.add(keyCls);
- 
-                         if (valMustDeserialize)
-                             mustDeserializeClss.add(valCls);
-                     }
- 
-                     QueryTypeIdKey typeId;
-                     QueryTypeIdKey altTypeId = null;
- 
-                     if (valCls == null || (binaryEnabled && !keyOrValMustDeserialize)) {
-                         processBinaryMeta(qryEntity, desc);
- 
-                         typeId = new QueryTypeIdKey(ccfg.getName(), ctx.cacheObjects().typeId(qryEntity.getValueType()));
- 
-                         if (valCls != null)
-                             altTypeId = new QueryTypeIdKey(ccfg.getName(), valCls);
- 
-                         if (!cctx.customAffinityMapper() && qryEntity.getKeyType() != null) {
-                             // Need to setup affinity key for distributed joins.
-                             String affField = ctx.cacheObjects().affinityField(qryEntity.getKeyType());
- 
-                             if (affField != null)
-                                 desc.affinityKey(affField);
-                         }
-                     }
-                     else {
-                         processClassMeta(qryEntity, desc, coCtx);
- 
-                         AffinityKeyMapper keyMapper = cctx.config().getAffinityMapper();
- 
-                         if (keyMapper instanceof GridCacheDefaultAffinityKeyMapper) {
-                             String affField =
-                                 ((GridCacheDefaultAffinityKeyMapper)keyMapper).affinityKeyPropertyName(desc.keyClass());
- 
-                             if (affField != null)
-                                 desc.affinityKey(affField);
-                         }
- 
-                         typeId = new QueryTypeIdKey(ccfg.getName(), valCls);
-                         altTypeId = new QueryTypeIdKey(ccfg.getName(), ctx.cacheObjects().typeId(qryEntity.getValueType()));
-                     }
+         CacheConfiguration<?,?> ccfg = cctx.config();
  
-                     addTypeByName(ccfg, desc);
-                     types.put(typeId, desc);
+         // Prepare candidates.
+         List<Class<?>> mustDeserializeClss = new ArrayList<>();
  
-                     if (altTypeId != null)
-                         types.put(altTypeId, desc);
+         Collection<QueryTypeCandidate> cands = new ArrayList<>();
  
-                     desc.registered(idx.registerType(ccfg.getName(), desc));
+         if (!F.isEmpty(ccfg.getQueryEntities())) {
+             for (QueryEntity qryEntity : ccfg.getQueryEntities()) {
+                 QueryTypeCandidate cand = QueryUtils.typeForQueryEntity(space, cctx, qryEntity, mustDeserializeClss);
  
-                     typeDescs.add(desc);
-                 }
+                 cands.add(cand);
              }
+         }
  
-             if (!F.isEmpty(ccfg.getTypeMetadata())) {
-                 for (CacheTypeMetadata meta : ccfg.getTypeMetadata()) {
-                     if (F.isEmpty(meta.getValueType()))
-                         throw new IgniteCheckedException("Value type is not set: " + meta);
- 
-                     if (meta.getQueryFields().isEmpty() && meta.getAscendingFields().isEmpty() &&
-                         meta.getDescendingFields().isEmpty() && meta.getGroups().isEmpty())
-                         continue;
- 
-                     QueryTypeDescriptorImpl desc = new QueryTypeDescriptorImpl(cctx.name());
- 
-                     // Key and value classes still can be available if they are primitive or JDK part.
-                     // We need that to set correct types for _key and _val columns.
-                     Class<?> keyCls = U.classForName(meta.getKeyType(), null);
-                     Class<?> valCls = U.classForName(meta.getValueType(), null);
- 
-                     // If local node has the classes and they are externalizable, we must use reflection properties.
-                     boolean keyMustDeserialize = mustDeserializeBinary(keyCls);
-                     boolean valMustDeserialize = mustDeserializeBinary(valCls);
- 
-                     boolean keyOrValMustDeserialize = keyMustDeserialize || valMustDeserialize;
- 
-                     if (keyCls == null)
-                         keyCls = Object.class;
- 
-                     String simpleValType = meta.getSimpleValueType();
- 
-                     if (simpleValType == null)
-                         simpleValType = typeName(meta.getValueType());
- 
-                     desc.name(simpleValType);
- 
-                     if (binaryEnabled && !keyOrValMustDeserialize) {
-                         // Safe to check null.
-                         if (SQL_TYPES.contains(valCls))
-                             desc.valueClass(valCls);
-                         else
-                             desc.valueClass(Object.class);
- 
-                         if (SQL_TYPES.contains(keyCls))
-                             desc.keyClass(keyCls);
-                         else
-                             desc.keyClass(Object.class);
-                     }
-                     else {
-                         desc.valueClass(valCls);
-                         desc.keyClass(keyCls);
-                     }
- 
-                     desc.keyTypeName(meta.getKeyType());
-                     desc.valueTypeName(meta.getValueType());
- 
-                     if (binaryEnabled && keyOrValMustDeserialize) {
-                         if (mustDeserializeClss == null)
-                             mustDeserializeClss = new ArrayList<>();
- 
-                         if (keyMustDeserialize)
-                             mustDeserializeClss.add(keyCls);
- 
-                         if (valMustDeserialize)
-                             mustDeserializeClss.add(valCls);
-                     }
+         if (!F.isEmpty(ccfg.getTypeMetadata())) {
+             for (CacheTypeMetadata meta : ccfg.getTypeMetadata()) {
+                 QueryTypeCandidate cand = QueryUtils.typeForCacheMetadata(space, cctx, meta, mustDeserializeClss);
  
-                     QueryTypeIdKey typeId;
-                     QueryTypeIdKey altTypeId = null;
+                 if (cand != null)
+                     cands.add(cand);
+             }
+         }
  
-                     if (valCls == null || (binaryEnabled && !keyOrValMustDeserialize)) {
-                         processBinaryMeta(meta, desc);
+         // Register candidates.
++        Collection<QueryTypeDescriptorImpl> typeDescs = new ArrayList<>();
 +
-                         typeId = new QueryTypeIdKey(ccfg.getName(), ctx.cacheObjects().typeId(meta.getValueType()));
+         idx.registerCache(space, cctx, cctx.config());
  
-                         if (valCls != null)
-                             altTypeId = new QueryTypeIdKey(ccfg.getName(), valCls);
-                     }
-                     else {
-                         processClassMeta(meta, desc, coCtx);
+         try {
+             for (QueryTypeCandidate cand : cands) {
+                 QueryTypeIdKey typeId = cand.typeId();
+                 QueryTypeIdKey altTypeId = cand.alternativeTypeId();
+                 QueryTypeDescriptorImpl desc = cand.descriptor();
  
-                         typeId = new QueryTypeIdKey(ccfg.getName(), valCls);
-                         altTypeId = new QueryTypeIdKey(ccfg.getName(), ctx.cacheObjects().typeId(meta.getValueType()));
-                     }
+                 if (typesByName.putIfAbsent(new QueryTypeNameKey(space, desc.name()), desc) != null)
+                     throw new IgniteCheckedException("Type with name '" + desc.name() + "' already indexed " +
+                         "in cache '" + space + "'.");
  
-                     addTypeByName(ccfg, desc);
-                     types.put(typeId, desc);
+                 types.put(typeId, desc);
  
-                     if (altTypeId != null)
-                         types.put(altTypeId, desc);
+                 if (altTypeId != null)
+                     types.put(altTypeId, desc);
  
-                     desc.registered(idx.registerType(ccfg.getName(), desc));
+                 desc.registered(idx.registerType(space, desc));
 +
-                     typeDescs.add(desc);
-                 }
-             }
- 
-             idxHnd.onCacheCreated(cctx.name(), typeDescs);
- 
-             if (mustDeserializeClss != null) {
-                 U.warn(log, "Some classes in query configuration cannot be written in binary format " +
-                     "because they either implement Externalizable interface or have writeObject/readObject methods. " +
-                     "Instances of these classes will be deserialized in order to build indexes. Please ensure that " +
-                     "all nodes have these classes in classpath. To enable binary serialization either implement " +
-                     Binarylizable.class.getSimpleName() + " interface or set explicit serializer using " +
-                     "BinaryTypeConfiguration.setSerializer() method: " + mustDeserializeClss);
++                typeDescs.add(desc);
              }
          }
          catch (IgniteCheckedException | RuntimeException e) {
@@@ -457,33 -193,16 +235,18 @@@
  
              throw e;
          }
-     }
  
-     /**
-      * Check whether type still must be deserialized when binary marshaller is set.
-      *
-      * @param cls Class.
-      * @return {@code True} if will be deserialized.
-      */
-     private boolean mustDeserializeBinary(Class cls) {
-         if (cls != null && ctx.config().getMarshaller() instanceof BinaryMarshaller) {
-             CacheObjectBinaryProcessorImpl proc0 = (CacheObjectBinaryProcessorImpl)ctx.cacheObjects();
++        idxHnd.onCacheCreated(cctx.name(), typeDescs);
 +
-             return proc0.binaryContext().mustDeserialize(cls);
+         // Warn about possible implicit deserialization.
+         if (!mustDeserializeClss.isEmpty()) {
+             U.warn(log, "Some classes in query configuration cannot be written in binary format " +
+                 "because they either implement Externalizable interface or have writeObject/readObject methods. " +
+                 "Instances of these classes will be deserialized in order to build indexes. Please ensure that " +
+                 "all nodes have these classes in classpath. To enable binary serialization either implement " +
+                 Binarylizable.class.getSimpleName() + " interface or set explicit serializer using " +
+                 "BinaryTypeConfiguration.setSerializer() method: " + mustDeserializeClss);
          }
-         else
-             return false;
-     }
- 
-     /**
-      * @param ccfg Cache configuration.
-      * @param desc Type descriptor.
-      * @throws IgniteCheckedException If failed.
-      */
-     private void addTypeByName(CacheConfiguration<?, ?> ccfg, QueryTypeDescriptorImpl desc) throws IgniteCheckedException {
-         if (typesByName.putIfAbsent(new QueryTypeNameKey(ccfg.getName(), desc.name()), desc) != null)
-             throw new IgniteCheckedException("Type with name '" + desc.name() + "' already indexed " +
-                 "in cache '" + ccfg.getName() + "'.");
      }
  
      /** {@inheritDoc} */
@@@ -558,10 -271,28 +321,30 @@@
              return;
  
          try {
-             idxHnd.onCacheStopped(cctx.name());
+             unregisterCache0(cctx.name());
+         }
+         finally {
+             busyLock.leaveBusy();
+         }
+     }
  
-             idx.unregisterCache(cctx.config());
+     /**
+      * Unregister cache.
+      *
+      * @param space Space.
+      */
+     private void unregisterCache0(String space) {
+         assert idx != null;
+ 
+         try {
++            idxHnd.onCacheStopped(cctx.name());
 +
+             idx.unregisterCache(space);
+         }
+         catch (Exception e) {
+             U.error(log, "Failed to clear indexing on cache unregister (will ignore): " + space, e);
+         }
+         finally {
              Iterator<Map.Entry<QueryTypeIdKey, QueryTypeDescriptorImpl>> it = types.entrySet().iterator();
  
              while (it.hasNext()) {

http://git-wip-us.apache.org/repos/asf/ignite/blob/8eaff405/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/DmlStatementsProcessor.java
----------------------------------------------------------------------
diff --cc modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/DmlStatementsProcessor.java
index 172f934,cbf39f6..9c38325
--- a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/DmlStatementsProcessor.java
+++ b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/DmlStatementsProcessor.java
@@@ -40,8 -39,8 +39,9 @@@ import javax.cache.processor.EntryProce
  import javax.cache.processor.MutableEntry;
  import org.apache.ignite.IgniteCache;
  import org.apache.ignite.IgniteCheckedException;
+ import org.apache.ignite.IgniteDataStreamer;
  import org.apache.ignite.IgniteException;
 +import org.apache.ignite.IgniteLogger;
  import org.apache.ignite.binary.BinaryArrayIdentityResolver;
  import org.apache.ignite.binary.BinaryObject;
  import org.apache.ignite.binary.BinaryObjectBuilder;
@@@ -73,11 -74,6 +75,10 @@@ import org.apache.ignite.lang.IgniteBiT
  import org.apache.ignite.lang.IgniteInClosure;
  import org.apache.ignite.spi.indexing.IndexingQueryFilter;
  import org.h2.command.Prepared;
 +import org.h2.command.dml.Delete;
 +import org.h2.command.dml.Insert;
 +import org.h2.command.dml.Merge;
 +import org.h2.command.dml.Update;
- import org.h2.jdbc.JdbcPreparedStatement;
  import org.h2.table.Column;
  import org.h2.value.DataType;
  import org.h2.value.Value;
@@@ -211,10 -212,91 +221,91 @@@ public class DmlStatementsProcessor 
      @SuppressWarnings("unchecked")
      GridQueryFieldsResult updateLocalSqlFields(String spaceName, PreparedStatement stmt,
          SqlFieldsQuery fieldsQry, IndexingQueryFilter filters, GridQueryCancel cancel) throws IgniteCheckedException {
-         long res = updateSqlFields(spaceName, stmt, fieldsQry, true, filters, cancel);
+         UpdateResult res = updateSqlFields(spaceName, stmt, fieldsQry, true, filters, cancel);
  
 -        return new GridQueryFieldsResultAdapter(UPDATE_RESULT_META,
 +        return new GridQueryFieldsResultAdapter(IgniteH2Indexing.UPDATE_RESULT_META,
-             new IgniteSingletonIterator(Collections.singletonList(res)));
+             new IgniteSingletonIterator(Collections.singletonList(res.cnt)));
+     }
+ 
+     /**
+      * Perform given statement against given data streamer. Only rows based INSERT and MERGE are supported
+      * as well as key bound UPDATE and DELETE (ones with filter {@code WHERE _key = ?}).
+      *
+      * @param streamer Streamer to feed data to.
+      * @param stmt Statement.
+      * @param args Statement arguments.
+      * @return Number of rows in given statement for INSERT and MERGE, {@code 1} otherwise.
+      * @throws IgniteCheckedException if failed.
+      */
+     @SuppressWarnings({"unchecked", "ConstantConditions"})
+     long streamUpdateQuery(IgniteDataStreamer streamer, PreparedStatement stmt, Object[] args)
+         throws IgniteCheckedException {
+         args = U.firstNotNull(args, X.EMPTY_OBJECT_ARRAY);
+ 
+         Prepared p = GridSqlQueryParser.prepared(stmt);
+ 
+         assert p != null;
+ 
+         UpdatePlan plan = UpdatePlanBuilder.planForStatement(p, null);
+ 
+         if (!F.eq(streamer.cacheName(), plan.tbl.rowDescriptor().context().namex()))
+             throw new IgniteSQLException("Cross cache streaming is not supported, please specify cache explicitly" +
+                 " in connection options", IgniteQueryErrorCode.UNSUPPORTED_OPERATION);
+ 
+         if (plan.mode == UpdateMode.INSERT && plan.rowsNum > 0) {
+             assert plan.isLocSubqry;
+ 
+             final GridCacheContext cctx = plan.tbl.rowDescriptor().context();
+ 
+             QueryCursorImpl<List<?>> cur;
+ 
+             final ArrayList<List<?>> data = new ArrayList<>(plan.rowsNum);
+ 
+             final GridQueryFieldsResult res = indexing.queryLocalSqlFields(cctx.name(), plan.selectQry,
+                 F.asList(args), null, false, 0, null);
+ 
+             QueryCursorImpl<List<?>> stepCur = new QueryCursorImpl<>(new Iterable<List<?>>() {
+                 @Override public Iterator<List<?>> iterator() {
+                     try {
+                         return new GridQueryCacheObjectsIterator(res.iterator(), cctx, cctx.keepBinary());
+                     }
+                     catch (IgniteCheckedException e) {
+                         throw new IgniteException(e);
+                     }
+                 }
+             }, null);
+ 
+             data.addAll(stepCur.getAll());
+ 
+             cur = new QueryCursorImpl<>(new Iterable<List<?>>() {
+                 @Override public Iterator<List<?>> iterator() {
+                     return data.iterator();
+                 }
+             }, null);
+ 
+             if (plan.rowsNum == 1) {
+                 IgniteBiTuple t = rowToKeyValue(cctx, cur.iterator().next(), plan);
+ 
+                 streamer.addData(t.getKey(), t.getValue());
+ 
+                 return 1;
+             }
+ 
+             Map<Object, Object> rows = new LinkedHashMap<>(plan.rowsNum);
+ 
+             for (List<?> row : cur) {
+                 final IgniteBiTuple t = rowToKeyValue(cctx, row, plan);
+ 
+                 rows.put(t.getKey(), t.getValue());
+             }
+ 
+             streamer.addData(rows);
+ 
+             return rows.size();
+         }
+         else
+             throw new IgniteSQLException("Only tuple based INSERT statements are supported in streaming mode",
+                 IgniteQueryErrorCode.UNSUPPORTED_OPERATION);
      }
  
      /**
@@@ -264,11 -336,11 +345,11 @@@
                  .setPageSize(fieldsQry.getPageSize())
                  .setTimeout(fieldsQry.getTimeout(), TimeUnit.MILLISECONDS);
  
 -            cur = (QueryCursorImpl<List<?>>) indexing.queryTwoStep(cctx, newFieldsQry, cancel);
 +            cur = (QueryCursorImpl<List<?>>) idx.queryTwoStep(cctx, newFieldsQry, cancel);
          }
          else {
-             final GridQueryFieldsResult res = idx.queryLocalSqlFields(cctx.name(), plan.selectQry, F.asList(params),
-                 filters, fieldsQry.isEnforceJoinOrder(), fieldsQry.getTimeout(), cancel);
 -            final GridQueryFieldsResult res = indexing.queryLocalSqlFields(cctx.name(), plan.selectQry,
++            final GridQueryFieldsResult res = idx.queryLocalSqlFields(cctx.name(), plan.selectQry,
+                 F.asList(fieldsQry.getArgs()), filters, fieldsQry.isEnforceJoinOrder(), fieldsQry.getTimeout(), cancel);
  
              cur = new QueryCursorImpl<>(new Iterable<List<?>>() {
                  @Override public Iterator<List<?>> iterator() {
@@@ -1008,32 -1103,6 +1112,16 @@@
              e.setValue(val);
          }
      }
 +
 +    /**
-      * Wrap result of DML operation (number of items affected) to Iterable suitable to be wrapped by cursor.
-      *
-      * @param itemsCnt Update result to wrap.
-      * @return Resulting Iterable.
-      */
-     @SuppressWarnings("unchecked")
-     public static QueryCursorImpl<List<?>> cursorForUpdateResult(long itemsCnt) {
-         QueryCursorImpl<List<?>> res =
-             new QueryCursorImpl(Collections.singletonList(Collections.singletonList(itemsCnt)), null, false);
- 
-         res.fieldsMeta(IgniteH2Indexing.UPDATE_RESULT_META);
- 
-         return res;
-     }
- 
-     /**
 +     * Check whether statement is DML statement.
 +     *
 +     * @param stmt Statement.
 +     * @return {@code True} if this is DML.
 +     */
 +    static boolean isDmlStatement(Prepared stmt) {
 +        return stmt instanceof Merge || stmt instanceof Insert || stmt instanceof Update || stmt instanceof Delete;
 +    }
  
      /** Update result - modifications count and keys to re-run query with, if needed. */
      private final static class UpdateResult {

http://git-wip-us.apache.org/repos/asf/ignite/blob/8eaff405/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/IgniteH2Indexing.java
----------------------------------------------------------------------
diff --cc modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/IgniteH2Indexing.java
index 1235724,4438343..eeb51056
--- a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/IgniteH2Indexing.java
+++ b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/IgniteH2Indexing.java
@@@ -91,9 -95,8 +95,10 @@@ import org.apache.ignite.internal.proce
  import org.apache.ignite.internal.processors.query.GridQueryIndexing;
  import org.apache.ignite.internal.processors.query.GridQueryProperty;
  import org.apache.ignite.internal.processors.query.GridQueryTypeDescriptor;
 +import org.apache.ignite.internal.processors.query.GridRunningQueryInfo;
  import org.apache.ignite.internal.processors.query.IgniteSQLException;
+ import org.apache.ignite.internal.processors.query.h2.opt.DistributedJoinMode;
 +import org.apache.ignite.internal.processors.query.h2.ddl.DdlStatementsProcessor;
  import org.apache.ignite.internal.processors.query.h2.opt.GridH2DefaultTableEngine;
  import org.apache.ignite.internal.processors.query.h2.opt.GridH2KeyValueRowOffheap;
  import org.apache.ignite.internal.processors.query.h2.opt.GridH2KeyValueRowOnheap;
@@@ -211,10 -216,9 +218,13 @@@ public class IgniteH2Indexing implement
          ";ROW_FACTORY=\"" + GridH2RowFactory.class.getName() + "\"" +
          ";DEFAULT_TABLE_ENGINE=" + GridH2DefaultTableEngine.class.getName();
  
+         // Uncomment this setting to get debug output from H2 to sysout.
+ //        ";TRACE_LEVEL_SYSTEM_OUT=3";
+ 
 +    /** Dummy metadata for update result. */
 +    static final List<GridQueryFieldMetadata> UPDATE_RESULT_META = Collections.<GridQueryFieldMetadata>
 +        singletonList(new SqlFieldMetadata(null, null, "UPDATED", Long.class.getName()));
 +
      /** */
      private static final int PREPARED_STMT_CACHE_SIZE = 256;
  
@@@ -448,10 -446,35 +458,35 @@@
      }
  
      /** {@inheritDoc} */
 -    @Override public PreparedStatement prepareNativeStatement(String schema, String sql) throws SQLException {
 -        return prepareStatement(connectionForSpace(space(schema)), sql, true);
 +    @Override public PreparedStatement prepareNativeStatement(String space, String sql) throws SQLException {
 +        return prepareStatement(connectionForSpace(space), sql, true);
      }
  
+     /** {@inheritDoc} */
+     @SuppressWarnings("unchecked")
+     @Override public IgniteDataStreamer<?, ?> createStreamer(String spaceName, PreparedStatement nativeStmt,
+         long autoFlushFreq, int nodeBufSize, int nodeParOps, boolean allowOverwrite) {
+         Prepared prep = GridSqlQueryParser.prepared((JdbcPreparedStatement) nativeStmt);
+ 
+         if (!(prep instanceof Insert))
+             throw new IgniteSQLException("Only INSERT operations are supported in streaming mode",
+                 IgniteQueryErrorCode.UNSUPPORTED_OPERATION);
+ 
+         IgniteDataStreamer streamer = ctx.grid().dataStreamer(spaceName);
+ 
+         streamer.autoFlushFrequency(autoFlushFreq);
+ 
+         streamer.allowOverwrite(allowOverwrite);
+ 
+         if (nodeBufSize > 0)
+             streamer.perNodeBufferSize(nodeBufSize);
+ 
+         if (nodeParOps > 0)
+             streamer.perNodeParallelOperations(nodeParOps);
+ 
+         return streamer;
+     }
+ 
      /**
       * Gets DB connection.
       *
@@@ -841,17 -877,8 +889,11 @@@
              fldsQry.setEnforceJoinOrder(enforceJoinOrder);
              fldsQry.setTimeout(timeout, TimeUnit.MILLISECONDS);
  
-             try {
-                 return dmlProc.updateLocalSqlFields(spaceName, stmt, fldsQry, filters, cancel);
-             }
-             catch (IgniteCheckedException e) {
-                 throw new IgniteSQLException("Failed to execute DML statement [stmt=" + qry + ", params=" +
-                     Arrays.deepToString(fldsQry.getArgs()) + "]", e);
-             }
+             return dmlProc.updateLocalSqlFields(spaceName, stmt, fldsQry, filter, cancel);
          }
 +        else if (DdlStatementsProcessor.isDdlStatement(p))
 +            throw new IgniteSQLException("DDL statements are supported for the whole cluster only",
 +                IgniteQueryErrorCode.UNSUPPORTED_OPERATION);
  
          List<GridQueryFieldMetadata> meta;
  
@@@ -1275,66 -1423,61 +1438,72 @@@
              boolean cachesCreated = false;
  
              try {
-                 while (true) {
-                     try {
-                         // Do not cache this statement because the whole two step query object will be cached later on.
-                         stmt = prepareStatement(c, sqlQry, false);
+                 try {
+                     while (true) {
+                         try {
+                             // Do not cache this statement because the whole two step query object will be cached later on.
+                             stmt = prepareStatement(c, sqlQry, false);
  
-                         break;
-                     }
-                     catch (SQLException e) {
-                         if (!cachesCreated && e.getErrorCode() == ErrorCode.SCHEMA_NOT_FOUND_1) {
-                             try {
-                                 ctx.cache().createMissingCaches();
-                             }
-                             catch (IgniteCheckedException ignored) {
-                                 throw new CacheException("Failed to create missing caches.", e);
-                             }
+                             break;
+                         }
+                         catch (SQLException e) {
+                             if (!cachesCreated && e.getErrorCode() == ErrorCode.SCHEMA_NOT_FOUND_1) {
+                                 try {
+                                     ctx.cache().createMissingCaches();
+                                 }
+                                 catch (IgniteCheckedException ignored) {
+                                     throw new CacheException("Failed to create missing caches.", e);
+                                 }
  
-                             cachesCreated = true;
+                                 cachesCreated = true;
+                             }
+                             else
+                                 throw new IgniteSQLException("Failed to parse query: " + sqlQry,
+                                     IgniteQueryErrorCode.PARSING, e);
                          }
-                         else
-                             throw new IgniteSQLException("Failed to parse query: " + sqlQry,
-                                 IgniteQueryErrorCode.PARSING, e);
                      }
-                 }
-             }
-             finally {
-                 GridH2QueryContext.clearThreadLocal();
-             }
  
-             Prepared prepared = GridSqlQueryParser.prepared((JdbcPreparedStatement) stmt);
  
-             if (qry instanceof JdbcSqlFieldsQuery && ((JdbcSqlFieldsQuery) qry).isQuery() != prepared.isQuery())
-                 throw new IgniteSQLException("Given statement type does not match that declared by JDBC driver",
-                     IgniteQueryErrorCode.STMT_TYPE_MISMATCH);
+                     Prepared prepared = GridSqlQueryParser.prepared(stmt);
  
-             if (!prepared.isQuery()) {
-                 if (DmlStatementsProcessor.isDmlStatement(prepared)) {
-                     try {
-                         return dmlProc.updateSqlFieldsTwoStep(cctx.namexx(), stmt, qry, cancel);
-                     }
-                     catch (IgniteCheckedException e) {
-                         throw new IgniteSQLException("Failed to execute DML statement [stmt=" + sqlQry + ", params=" +
-                             Arrays.deepToString(qry.getArgs()) + "]", e);
+                     if (qry instanceof JdbcSqlFieldsQuery && ((JdbcSqlFieldsQuery) qry).isQuery() != prepared.isQuery())
+                         throw new IgniteSQLException("Given statement type does not match that declared by JDBC driver",
+                             IgniteQueryErrorCode.STMT_TYPE_MISMATCH);
+ 
+                     if (prepared.isQuery()) {
+                         bindParameters(stmt, F.asList(qry.getArgs()));
+ 
+                         twoStepQry = GridSqlQuerySplitter.split((JdbcPreparedStatement)stmt, qry.getArgs(), grpByCollocated,
+                             distributedJoins, enforceJoinOrder, this);
+ 
+                         assert twoStepQry != null;
                      }
                  }
+                 finally {
+                     GridH2QueryContext.clearThreadLocal();
+                 }
  
-                 if (DdlStatementsProcessor.isDdlStatement(prepared)) {
-                     try {
-                         return ddlProc.runDdlStatement(stmt);
+                 // It is a DML statement if we did not create a twoStepQuery.
+                 if (twoStepQry == null) {
 -                    try {
 -                        return dmlProc.updateSqlFieldsTwoStep(cctx.namexx(), stmt, qry, cancel);
++                    if (DmlStatementsProcessor.isDmlStatement(prepared)) {
++                        try {
++                            return dmlProc.updateSqlFieldsTwoStep(cctx.namexx(), stmt, qry, cancel);
++                        }
++                        catch (IgniteCheckedException e) {
++                            throw new IgniteSQLException("Failed to execute DML statement [stmt=" + sqlQry + ", params=" +
++                                Arrays.deepToString(qry.getArgs()) + "]", e);
++                        }
                      }
--                    catch (IgniteCheckedException e) {
-                         throw new IgniteSQLException("Failed to execute DDL statement [stmt=" + sqlQry + ']', e);
 -                        throw new IgniteSQLException("Failed to execute DML statement [qry=" + sqlQry + ", params=" +
 -                            Arrays.deepToString(qry.getArgs()) + "]", e);
++
++                    if (DdlStatementsProcessor.isDdlStatement(prepared)) {
++                        try {
++                            return ddlProc.runDdlStatement(stmt);
++                        }
++                        catch (IgniteCheckedException e) {
++                            throw new IgniteSQLException("Failed to execute DDL statement [stmt=" + sqlQry + ']', e);
++                        }
                      }
                  }
-             }
- 
-             try {
-                 bindParameters(stmt, F.asList(qry.getArgs()));
- 
-                 twoStepQry = GridSqlQuerySplitter.split((JdbcPreparedStatement)stmt, qry.getArgs(), grpByCollocated,
-                     distributedJoins);
  
                  List<Integer> caches;
                  List<Integer> extraCaches = null;
@@@ -2629,31 -2783,41 +2833,32 @@@
                  String name = e.getKey();
                  GridQueryIndexDescriptor idx = e.getValue();
  
 -                if (idx.type() == QueryIndexType.FULLTEXT) {
 -                    try {
 -                        luceneIdx = new GridLuceneIndex(ctx, schema.offheap, schema.spaceName, type);
 -                    }
 -                    catch (IgniteCheckedException e1) {
 -                        throw new IgniteException(e1);
 -                    }
 -                }
 -                else {
 -                    List<IndexColumn> cols = new ArrayList<>(idx.fields().size() + 2);
 +                List<IndexColumn> cols = new ArrayList<>(idx.fields().size() + 2);
  
 -                    boolean escapeAll = schema.escapeAll();
 +                boolean escapeAll = schema.escapeAll();
  
 -                    for (String field : idx.fields()) {
 -                        String fieldName = escapeAll ? field : escapeName(field, false).toUpperCase();
 +                for (String field : idx.fields()) {
 +                    String fieldName = escapeAll ? field : escapeName(field, false).toUpperCase();
  
 -                        Column col = tbl.getColumn(fieldName);
 +                    Column col = tbl.getColumn(fieldName);
  
 -                        cols.add(tbl.indexColumn(col.getColumnId(),
 -                            idx.descending(field) ? SortOrder.DESCENDING : SortOrder.ASCENDING));
 -                    }
 +                    cols.add(tbl.indexColumn(col.getColumnId(),
 +                        idx.descending(field) ? SortOrder.DESCENDING : SortOrder.ASCENDING));
 +                }
  
 -                    if (idx.type() == QueryIndexType.SORTED) {
 -                        // We don't care about number of fields in affinity index, just affinity key must be the first.
 -                        affIdxFound |= affCol != null && equal(cols.get(0), affCol);
 +                if (idx.type() == QueryIndexType.SORTED) {
 +                    // We don't care about number of fields in affinity index, just affinity key must be the first.
 +                    affIdxFound |= affCol != null && equal(cols.get(0), affCol);
  
 -                        cols = treeIndexColumns(cols, keyCol, affCol);
 +                    cols = treeIndexColumns(cols, keyCol, affCol);
  
-                     idxs.add(new GridH2TreeIndex(name, tbl, false, cols));
+                         idxs.add(createTreeIndex(name, tbl, false, cols));
+                     }
+                     else if (idx.type() == QueryIndexType.GEOSPATIAL)
+                         idxs.add(createH2SpatialIndex(tbl, name, cols.toArray(new IndexColumn[cols.size()])));
+                     else
+                         throw new IllegalStateException("Index type: " + idx.type());
                  }
-                 else if (idx.type() == QueryIndexType.GEOSPATIAL)
-                     idxs.add(createH2SpatialIndex(tbl, name, cols.toArray(new IndexColumn[cols.size()])));
-                 else
-                     throw new IllegalStateException("Index type: " + idx.type());
              }
  
              // Add explicit affinity key index if nothing alike was found.

http://git-wip-us.apache.org/repos/asf/ignite/blob/8eaff405/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/sql/GridSqlQueryParser.java
----------------------------------------------------------------------
diff --cc modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/sql/GridSqlQueryParser.java
index e8e1737,16d7105..4c526a2
--- a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/sql/GridSqlQueryParser.java
+++ b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/sql/GridSqlQueryParser.java
@@@ -27,10 -28,6 +28,8 @@@ import java.util.List
  import java.util.Map;
  import javax.cache.CacheException;
  import org.apache.ignite.IgniteException;
 +import org.apache.ignite.cache.QueryIndex;
 +import org.apache.ignite.cache.QueryIndexType;
- import org.apache.ignite.internal.processors.cache.query.IgniteQueryErrorCode;
- import org.apache.ignite.internal.processors.query.IgniteSQLException;
  import org.h2.command.Command;
  import org.h2.command.CommandContainer;
  import org.h2.command.Prepared;
@@@ -303,50 -297,26 +304,68 @@@ public class GridSqlQueryParser 
          GridSqlQueryParser.<Command, Prepared>getter(CommandContainer.class, "prepared");
  
      /** */
 +    private static final Getter<CreateIndex, String> CREATE_INDEX_NAME = getter(CreateIndex.class, "indexName");
 +
 +    /** */
 +    private static final Getter<CreateIndex, String> CREATE_INDEX_TABLE_NAME = getter(CreateIndex.class, "tableName");
 +
 +    /** */
 +    private static final Getter<CreateIndex, IndexColumn[]> CREATE_INDEX_COLUMNS = getter(CreateIndex.class,
 +        "indexColumns");
 +
 +    /** */
 +    private static final Getter<CreateIndex, Boolean> CREATE_INDEX_SPATIAL = getter(CreateIndex.class, "spatial");
 +
 +    /** */
 +    private static final Getter<CreateIndex, Boolean> CREATE_INDEX_PRIMARY_KEY = getter(CreateIndex.class,
 +        "primaryKey");
 +
 +    /** */
 +    private static final Getter<CreateIndex, Boolean> CREATE_INDEX_UNIQUE = getter(CreateIndex.class, "unique");
 +
 +    /** */
 +    private static final Getter<CreateIndex, Boolean> CREATE_INDEX_HASH = getter(CreateIndex.class, "hash");
 +
 +    /** */
 +    private static final Getter<CreateIndex, Boolean> CREATE_INDEX_IF_NOT_EXISTS = getter(CreateIndex.class,
 +        "ifNotExists");
 +
 +    /** */
 +    private static final Getter<IndexColumn, String> INDEX_COLUMN_NAME = getter(IndexColumn.class, "columnName");
 +
 +    /** */
 +    private static final Getter<IndexColumn, Integer> INDEX_COLUMN_SORT_TYPE = getter(IndexColumn.class, "sortType");
 +
 +    /** */
 +    private static final Getter<DropIndex, String> DROP_INDEX_NAME = getter(DropIndex.class, "indexName");
 +
 +    /** */
 +    private static final Getter<DropIndex, Boolean> DROP_INDEX_IF_EXISTS = getter(DropIndex.class, "ifExists");
 +
 +    /** */
 +    private static final Getter<SchemaCommand, Schema> SCHEMA_COMMAND_SCHEMA = getter(SchemaCommand.class, "schema");
 +
 +    /** */
      private final IdentityHashMap<Object, Object> h2ObjToGridObj = new IdentityHashMap<>();
  
+     /** */
+     private final Map<String, Integer> optimizedTableFilterOrder;
+ 
+     /**
+      * We have a counter instead of a simple flag, because
+      * a flag can be reset earlier than needed in case of
+      * deep subquery expression nesting.
+      */
+     private int parsingSubQryExpression;
+ 
+     /**
+      * @param useOptimizedSubqry If we have to find correct order for table filters in FROM clause.
+      *                           Relies on uniqueness of table filter aliases.
+      */
+     public GridSqlQueryParser(boolean useOptimizedSubqry) {
+         optimizedTableFilterOrder = useOptimizedSubqry ? new HashMap<String, Integer>() : null;
+     }
+ 
      /**
       * @param stmt Prepared statement.
       * @return Parsed select.
@@@ -746,51 -691,33 +806,45 @@@
      }
  
      /**
-      * @param qry Prepared.
-      * @return Query.
+      * @param stmt Prepared statement.
+      * @return Parsed AST.
       */
-     public GridSqlStatement parse(Prepared qry) {
-         return parse(qry, null);
-     }
+     public final GridSqlStatement parse(Prepared stmt) {
+         if (stmt instanceof Query) {
+             if (optimizedTableFilterOrder != null)
+                 collectOptimizedTableFiltersOrder((Query)stmt);
  
-     /**
-      * @param qry Select.
-      */
-     public GridSqlStatement parse(Prepared qry, @Nullable Query idxQry) {
-         assert qry != null;
+             return parseQuery((Query)stmt);
+         }
  
-         if (qry instanceof Query)
-             return parse((Query)qry, idxQry);
+         if (stmt instanceof Merge)
+             return parseMerge((Merge)stmt);
  
-         if (qry instanceof Merge)
-             return parseMerge((Merge)qry);
+         if (stmt instanceof Insert)
+             return parseInsert((Insert)stmt);
  
-         if (qry instanceof Insert)
-             return parseInsert((Insert)qry);
+         if (stmt instanceof Delete)
+             return parseDelete((Delete)stmt);
  
-         if (qry instanceof Delete)
-             return parseDelete((Delete)qry);
+         if (stmt instanceof Update)
+             return parseUpdate((Update)stmt);
+ 
+         if (stmt instanceof Explain)
+             return parse(EXPLAIN_COMMAND.get((Explain)stmt)).explain(true);
  
 +        if (qry instanceof Update)
 +            return parseUpdate((Update)qry);
 +
++        if (stmt instanceof Explain)
++            return parse(EXPLAIN_COMMAND.get((Explain)stmt)).explain(true);
++
 +        if (qry instanceof CreateIndex)
 +            return parseCreateIndex((CreateIndex) qry);
 +
 +        if (qry instanceof DropIndex)
 +            return parseDropIndex((DropIndex) qry);
 +
-         if (qry instanceof Explain) {
-             GridSqlStatement stmt = parse(EXPLAIN_COMMAND.get((Explain) qry));
- 
-             if (!(stmt instanceof GridSqlQuery))
-                 throw new IgniteSQLException("EXPLAIN is not supported for DML statement: " + qry,
-                     IgniteQueryErrorCode.UNSUPPORTED_OPERATION);
- 
-             return stmt.explain(true);
-         }
- 
-         throw new IgniteSQLException("Unsupported statement: " + qry, IgniteQueryErrorCode.UNSUPPORTED_OPERATION);
+         throw new CacheException("Unsupported SQL statement: " + stmt);
      }
  
      /**

http://git-wip-us.apache.org/repos/asf/ignite/blob/8eaff405/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/h2/GridIndexingSpiAbstractSelfTest.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/ignite/blob/8eaff405/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/h2/sql/GridQueryParsingTest.java
----------------------------------------------------------------------


Mime
View raw message