ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject [13/26] ignite git commit: IGNITE-4594 - SQL Index hints - Fixes #1832.
Date Mon, 24 Apr 2017 09:11:39 GMT
IGNITE-4594 - SQL Index hints - Fixes #1832.

Signed-off-by: Sergi Vladykin <sergi.vladykin@gmail.com>


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

Branch: refs/heads/ignite-1794
Commit: 457c551581ee96891b62b834d8bbc0358679dade
Parents: a6f8b69
Author: skalashnikov <skalashnikov@gridgain.com>
Authored: Fri Apr 21 16:40:32 2017 +0300
Committer: Sergi Vladykin <sergi.vladykin@gmail.com>
Committed: Fri Apr 21 16:40:32 2017 +0300

----------------------------------------------------------------------
 .../query/h2/opt/GridH2SpatialIndex.java        |  8 +++-
 .../query/h2/database/H2PkHashIndex.java        |  6 ++-
 .../query/h2/database/H2TreeIndex.java          |  6 ++-
 .../query/h2/database/InlineIndexHelper.java    | 14 ------
 .../query/h2/opt/GridH2IndexBase.java           |  4 +-
 .../query/h2/opt/GridH2MetaTable.java           |  8 ++--
 .../query/h2/opt/GridH2PrimaryScanIndex.java    |  7 ++-
 .../processors/query/h2/opt/GridH2Row.java      |  2 +-
 .../query/h2/opt/GridH2ScanIndex.java           |  4 +-
 .../processors/query/h2/opt/GridH2Table.java    |  7 ++-
 .../query/h2/opt/GridH2TreeIndex.java           |  7 ++-
 .../processors/query/h2/sql/DmlAstUtils.java    |  3 --
 .../processors/query/h2/sql/GridSqlAlias.java   | 20 ++++++++-
 .../query/h2/sql/GridSqlQueryParser.java        |  4 ++
 .../processors/query/h2/sql/GridSqlTable.java   | 46 ++++++++++++++++++++
 .../query/h2/twostep/GridMergeIndex.java        |  1 +
 .../query/h2/twostep/GridMergeIndexSorted.java  |  6 ++-
 .../h2/twostep/GridMergeIndexUnsorted.java      |  6 ++-
 .../query/h2/twostep/GridMergeTable.java        | 12 +++--
 .../query/h2/twostep/GridThreadLocalTable.java  |  9 ++--
 .../query/IgniteSqlSplitterSelfTest.java        | 34 ++++++++++++++-
 .../h2/database/InlineIndexHelperTest.java      |  8 ----
 .../query/h2/sql/GridQueryParsingTest.java      | 29 +++++++++---
 parent/pom.xml                                  |  2 +-
 24 files changed, 186 insertions(+), 67 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/457c5515/modules/geospatial/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridH2SpatialIndex.java
----------------------------------------------------------------------
diff --git a/modules/geospatial/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridH2SpatialIndex.java
b/modules/geospatial/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridH2SpatialIndex.java
index bc27ae7..c8f3f68 100644
--- a/modules/geospatial/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridH2SpatialIndex.java
+++ b/modules/geospatial/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridH2SpatialIndex.java
@@ -22,6 +22,7 @@ import com.vividsolutions.jts.geom.Geometry;
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.HashMap;
+import java.util.HashSet;
 import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
@@ -45,6 +46,7 @@ import org.h2.mvstore.rtree.MVRTreeMap;
 import org.h2.mvstore.rtree.SpatialKey;
 import org.h2.result.SearchRow;
 import org.h2.result.SortOrder;
+import org.h2.table.Column;
 import org.h2.table.IndexColumn;
 import org.h2.table.TableFilter;
 import org.h2.value.Value;
@@ -260,7 +262,8 @@ public class GridH2SpatialIndex extends GridH2IndexBase implements SpatialIndex
     }
 
     /** {@inheritDoc} */
-    @Override public double getCost(Session ses, int[] masks, TableFilter[] filters, int
filter, SortOrder sortOrder) {
+    @Override public double getCost(Session ses, int[] masks, TableFilter[] filters, int
filter,
+        SortOrder sortOrder, HashSet<Column> cols) {
         return SpatialTreeIndex.getCostRangeIndex(masks,
             table.getRowCountApproximation(), columns) / 10;
     }
@@ -370,7 +373,8 @@ public class GridH2SpatialIndex extends GridH2IndexBase implements SpatialIndex
     }
 
     /** {@inheritDoc} */
-    @Override public Cursor findByGeometry(TableFilter filter, SearchRow intersection) {
+    @Override public Cursor findByGeometry(TableFilter filter, SearchRow first, SearchRow
last,
+        SearchRow intersection) {
         Lock l = lock.readLock();
 
         l.lock();

http://git-wip-us.apache.org/repos/asf/ignite/blob/457c5515/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/database/H2PkHashIndex.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/database/H2PkHashIndex.java
b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/database/H2PkHashIndex.java
index fb6ea95..149eda7 100644
--- a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/database/H2PkHashIndex.java
+++ b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/database/H2PkHashIndex.java
@@ -19,6 +19,7 @@
 package org.apache.ignite.internal.processors.query.h2.database;
 
 import java.util.ArrayList;
+import java.util.HashSet;
 import java.util.Iterator;
 import java.util.List;
 import org.apache.ignite.IgniteCheckedException;
@@ -40,6 +41,7 @@ import org.h2.message.DbException;
 import org.h2.result.Row;
 import org.h2.result.SearchRow;
 import org.h2.result.SortOrder;
+import org.h2.table.Column;
 import org.h2.table.IndexColumn;
 import org.h2.table.TableFilter;
 import org.jetbrains.annotations.Nullable;
@@ -157,10 +159,10 @@ public class H2PkHashIndex extends GridH2IndexBase {
     }
 
     /** {@inheritDoc} */
-    @Override public double getCost(Session ses, int[] masks, TableFilter[] filters, int
filter, SortOrder sortOrder) {
+    @Override public double getCost(Session ses, int[] masks, TableFilter[] filters, int
filter, SortOrder sortOrder, HashSet<Column> allColumnsSet) {
         long rowCnt = getRowCountApproximation();
 
-        double baseCost = getCostRangeIndex(masks, rowCnt, filters, filter, sortOrder, false);
+        double baseCost = getCostRangeIndex(masks, rowCnt, filters, filter, sortOrder, false,
allColumnsSet);
 
         int mul = getDistributedMultiplier(ses, filters, filter);
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/457c5515/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/database/H2TreeIndex.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/database/H2TreeIndex.java
b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/database/H2TreeIndex.java
index 1ea3204..58ab32d 100644
--- a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/database/H2TreeIndex.java
+++ b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/database/H2TreeIndex.java
@@ -18,6 +18,7 @@
 package org.apache.ignite.internal.processors.query.h2.database;
 
 import java.util.ArrayList;
+import java.util.HashSet;
 import java.util.List;
 import org.apache.ignite.IgniteCheckedException;
 import org.apache.ignite.IgniteException;
@@ -43,6 +44,7 @@ import org.h2.index.SingleRowCursor;
 import org.h2.message.DbException;
 import org.h2.result.SearchRow;
 import org.h2.result.SortOrder;
+import org.h2.table.Column;
 import org.h2.table.IndexColumn;
 import org.h2.table.TableFilter;
 import org.h2.value.Value;
@@ -272,10 +274,10 @@ public class H2TreeIndex extends GridH2IndexBase {
     }
 
     /** {@inheritDoc} */
-    @Override public double getCost(Session ses, int[] masks, TableFilter[] filters, int
filter, SortOrder sortOrder) {
+    @Override public double getCost(Session ses, int[] masks, TableFilter[] filters, int
filter, SortOrder sortOrder, HashSet<Column> allColumnsSet) {
         long rowCnt = getRowCountApproximation();
 
-        double baseCost = getCostRangeIndex(masks, rowCnt, filters, filter, sortOrder, false);
+        double baseCost = getCostRangeIndex(masks, rowCnt, filters, filter, sortOrder, false,
allColumnsSet);
 
         int mul = getDistributedMultiplier(ses, filters, filter);
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/457c5515/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/database/InlineIndexHelper.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/database/InlineIndexHelper.java
b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/database/InlineIndexHelper.java
index 7381924..1fd45f3 100644
--- a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/database/InlineIndexHelper.java
+++ b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/database/InlineIndexHelper.java
@@ -41,7 +41,6 @@ import org.h2.value.ValueStringFixed;
 import org.h2.value.ValueStringIgnoreCase;
 import org.h2.value.ValueTime;
 import org.h2.value.ValueTimestamp;
-import org.h2.value.ValueTimestampUtc;
 import org.h2.value.ValueUuid;
 
 /**
@@ -66,7 +65,6 @@ public class InlineIndexHelper {
         Value.DATE,
         Value.TIME,
         Value.TIMESTAMP,
-        Value.TIMESTAMP_UTC,
         Value.UUID,
         Value.STRING,
         Value.STRING_FIXED,
@@ -134,10 +132,6 @@ public class InlineIndexHelper {
                 this.size = 16;
                 break;
 
-            case Value.TIMESTAMP_UTC:
-                this.size = 8;
-                break;
-
             case Value.UUID:
                 this.size = 16;
                 break;
@@ -276,9 +270,6 @@ public class InlineIndexHelper {
             case Value.TIMESTAMP:
                 return ValueTimestamp.fromDateValueAndNanos(PageUtils.getLong(pageAddr, off
+ 1), PageUtils.getLong(pageAddr, off + 9));
 
-            case Value.TIMESTAMP_UTC:
-                return ValueTimestampUtc.fromNanos(PageUtils.getLong(pageAddr, off + 1));
-
             case Value.UUID:
                 return ValueUuid.get(PageUtils.getLong(pageAddr, off + 1), PageUtils.getLong(pageAddr,
off + 9));
 
@@ -434,11 +425,6 @@ public class InlineIndexHelper {
                 PageUtils.putLong(pageAddr, off + 9, ((ValueTimestamp)val).getTimeNanos());
                 return size + 1;
 
-            case Value.TIMESTAMP_UTC:
-                PageUtils.putByte(pageAddr, off, (byte)val.getType());
-                PageUtils.putLong(pageAddr, off + 1, ((ValueTimestampUtc)val).getUtcDateTimeNanos());
-                return size + 1;
-
             case Value.UUID:
                 PageUtils.putByte(pageAddr, off, (byte)val.getType());
                 PageUtils.putLong(pageAddr, off + 1, ((ValueUuid)val).getHigh());

http://git-wip-us.apache.org/repos/asf/ignite/blob/457c5515/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridH2IndexBase.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridH2IndexBase.java
b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridH2IndexBase.java
index 0eac559..9dab752 100644
--- a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridH2IndexBase.java
+++ b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridH2IndexBase.java
@@ -390,7 +390,7 @@ public abstract class GridH2IndexBase extends BaseIndex {
     }
 
     /** {@inheritDoc} */
-    @Override public IndexLookupBatch createLookupBatch(TableFilter filter) {
+    @Override public IndexLookupBatch createLookupBatch(TableFilter[] filters, int filter)
{
         GridH2QueryContext qctx = GridH2QueryContext.get();
 
         if (qctx == null || qctx.distributedJoinMode() == OFF || !getTable().isPartitioned())
@@ -403,7 +403,7 @@ public abstract class GridH2IndexBase extends BaseIndex {
 
         if (affCol != null) {
             affColId = affCol.column.getColumnId();
-            int[] masks = filter.getMasks();
+            int[] masks = filters[filter].getMasks();
 
             if (masks != null) {
                 ucast = (masks[affColId] & IndexCondition.EQUALITY) != 0 ||

http://git-wip-us.apache.org/repos/asf/ignite/blob/457c5515/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridH2MetaTable.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridH2MetaTable.java
b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridH2MetaTable.java
index 3b752bc..d23515b 100644
--- a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridH2MetaTable.java
+++ b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridH2MetaTable.java
@@ -19,6 +19,7 @@ package org.apache.ignite.internal.processors.query.h2.opt;
 
 import java.util.ArrayList;
 import java.util.Collections;
+import java.util.HashSet;
 import java.util.Objects;
 import java.util.Set;
 import java.util.concurrent.ConcurrentMap;
@@ -39,6 +40,7 @@ import org.h2.table.Column;
 import org.h2.table.IndexColumn;
 import org.h2.table.TableBase;
 import org.h2.table.TableFilter;
+import org.h2.table.TableType;
 import org.h2.value.Value;
 import org.h2.value.ValueInt;
 import org.jsr166.ConcurrentHashMap8;
@@ -145,8 +147,8 @@ public class GridH2MetaTable extends TableBase {
     }
 
     /** {@inheritDoc} */
-    @Override public String getTableType() {
-        return SYSTEM_TABLE;
+    @Override public TableType getTableType() {
+        return TableType.SYSTEM_TABLE;
     }
 
     /** {@inheritDoc} */
@@ -338,7 +340,7 @@ public class GridH2MetaTable extends TableBase {
 
         /** {@inheritDoc} */
         @Override public double getCost(Session session, int[] masks, TableFilter[] filters,
-            int filter, SortOrder sortOrder) {
+            int filter, SortOrder sortOrder, HashSet<Column> cols) {
             if ((masks[ID] & IndexCondition.EQUALITY) == IndexCondition.EQUALITY)
                 return 1;
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/457c5515/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridH2PrimaryScanIndex.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridH2PrimaryScanIndex.java
b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridH2PrimaryScanIndex.java
index 097b34e..6c49ac2 100644
--- a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridH2PrimaryScanIndex.java
+++ b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridH2PrimaryScanIndex.java
@@ -19,9 +19,12 @@ package org.apache.ignite.internal.processors.query.h2.opt;
 
 import org.h2.engine.Session;
 import org.h2.result.SortOrder;
+import org.h2.table.Column;
 import org.h2.table.TableFilter;
 import org.jetbrains.annotations.Nullable;
 
+import java.util.HashSet;
+
 /**
  * Wrapper type for primary key.
  */
@@ -65,10 +68,10 @@ public class GridH2PrimaryScanIndex extends GridH2ScanIndex<GridH2IndexBase>
{
 
     /** {@inheritDoc} */
     @Override public double getCost(Session ses, int[] masks, TableFilter[] filters, int
filter,
-        SortOrder sortOrder) {
+        SortOrder sortOrder, HashSet<Column> allColumnsSet) {
         long rows = getRowCountApproximation();
 
-        double baseCost = getCostRangeIndex(masks, rows, filters, filter, sortOrder, true);
+        double baseCost = getCostRangeIndex(masks, rows, filters, filter, sortOrder, true,
allColumnsSet);
 
         int mul = delegate().getDistributedMultiplier(ses, filters, filter);
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/457c5515/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridH2Row.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridH2Row.java
b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridH2Row.java
index 042e163..7de6740 100644
--- a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridH2Row.java
+++ b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridH2Row.java
@@ -29,7 +29,7 @@ import org.h2.value.Value;
 /**
  * Row with locking support needed for unique key conflicts resolution.
  */
-public abstract class GridH2Row extends Row implements GridSearchRowPointer, CacheDataRow
{
+public abstract class GridH2Row implements GridSearchRowPointer, CacheDataRow, Row {
     /** */
     public long link; // TODO remove
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/457c5515/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridH2ScanIndex.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridH2ScanIndex.java
b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridH2ScanIndex.java
index 3b486c6..b3d3952 100644
--- a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridH2ScanIndex.java
+++ b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridH2ScanIndex.java
@@ -184,8 +184,8 @@ public abstract class GridH2ScanIndex<D extends BaseIndex> extends
BaseIndex {
     }
 
     /** {@inheritDoc} */
-    @Override public IndexLookupBatch createLookupBatch(TableFilter filter) {
-        return delegate().createLookupBatch(filter);
+    @Override public IndexLookupBatch createLookupBatch(TableFilter[] filters, int filter)
{
+        return delegate().createLookupBatch(filters, filter);
     }
 
     /** {@inheritDoc} */

http://git-wip-us.apache.org/repos/asf/ignite/blob/457c5515/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridH2Table.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridH2Table.java
b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridH2Table.java
index c07dce4..b9394ec 100644
--- a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridH2Table.java
+++ b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridH2Table.java
@@ -19,6 +19,7 @@ package org.apache.ignite.internal.processors.query.h2.opt;
 
 import java.util.ArrayList;
 import java.util.HashMap;
+import java.util.HashSet;
 import java.util.Map;
 import java.util.concurrent.ConcurrentMap;
 import java.util.concurrent.TimeUnit;
@@ -44,8 +45,10 @@ import org.h2.message.DbException;
 import org.h2.result.Row;
 import org.h2.result.SearchRow;
 import org.h2.result.SortOrder;
+import org.h2.table.Column;
 import org.h2.table.IndexColumn;
 import org.h2.table.TableBase;
+import org.h2.table.TableType;
 import org.h2.value.Value;
 import org.jetbrains.annotations.Nullable;
 import org.jsr166.ConcurrentHashMap8;
@@ -803,8 +806,8 @@ public class GridH2Table extends TableBase {
     }
 
     /** {@inheritDoc} */
-    @Override public String getTableType() {
-        return EXTERNAL_TABLE_ENGINE;
+    @Override public TableType getTableType() {
+        return TableType.EXTERNAL_TABLE_ENGINE;
     }
 
     /** {@inheritDoc} */

http://git-wip-us.apache.org/repos/asf/ignite/blob/457c5515/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridH2TreeIndex.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridH2TreeIndex.java
b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridH2TreeIndex.java
index cf75395..56f6667 100644
--- a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridH2TreeIndex.java
+++ b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridH2TreeIndex.java
@@ -19,6 +19,7 @@ package org.apache.ignite.internal.processors.query.h2.opt;
 
 import java.util.Collection;
 import java.util.Comparator;
+import java.util.HashSet;
 import java.util.List;
 import java.util.Map;
 import java.util.NavigableMap;
@@ -40,6 +41,7 @@ import org.h2.index.SingleRowCursor;
 import org.h2.message.DbException;
 import org.h2.result.SearchRow;
 import org.h2.result.SortOrder;
+import org.h2.table.Column;
 import org.h2.table.IndexColumn;
 import org.h2.table.TableFilter;
 import org.h2.value.Value;
@@ -258,9 +260,10 @@ public class GridH2TreeIndex extends GridH2IndexBase implements Comparator<GridS
     }
 
     /** {@inheritDoc} */
-    @Override public double getCost(Session ses, int[] masks, TableFilter[] filters, int
filter, SortOrder sortOrder) {
+    @Override public double getCost(Session ses, int[] masks, TableFilter[] filters, int
filter,
+        SortOrder sortOrder, HashSet<Column> cols) {
         long rowCnt = getRowCountApproximation();
-        double baseCost = getCostRangeIndex(masks, rowCnt, filters, filter, sortOrder, false);
+        double baseCost = getCostRangeIndex(masks, rowCnt, filters, filter, sortOrder, false,
cols);
         int mul = getDistributedMultiplier(ses, filters, filter);
 
         return mul * baseCost;

http://git-wip-us.apache.org/repos/asf/ignite/blob/457c5515/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/sql/DmlAstUtils.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/sql/DmlAstUtils.java
b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/sql/DmlAstUtils.java
index 974a5b8..91694ae 100644
--- a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/sql/DmlAstUtils.java
+++ b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/sql/DmlAstUtils.java
@@ -46,7 +46,6 @@ import org.h2.value.ValueInt;
 import org.h2.value.ValueString;
 import org.h2.value.ValueTime;
 import org.h2.value.ValueTimestamp;
-import org.h2.value.ValueTimestampUtc;
 import org.jetbrains.annotations.Nullable;
 
 /**
@@ -397,8 +396,6 @@ public final class DmlAstUtils {
             dfltVal = ValueInt.get(0).convertTo(type);
         else if (dt.type == Value.TIMESTAMP)
             dfltVal = ValueTimestamp.fromMillis(U.currentTimeMillis());
-        else if (dt.type == Value.TIMESTAMP_UTC)
-            dfltVal = ValueTimestampUtc.fromMillis(U.currentTimeMillis());
         else if (dt.type == Value.TIME)
             dfltVal = ValueTime.fromNanos(0);
         else if (dt.type == Value.DATE)

http://git-wip-us.apache.org/repos/asf/ignite/blob/457c5515/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/sql/GridSqlAlias.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/sql/GridSqlAlias.java
b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/sql/GridSqlAlias.java
index eb84c90..e8c82fd 100644
--- a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/sql/GridSqlAlias.java
+++ b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/sql/GridSqlAlias.java
@@ -18,6 +18,8 @@
 package org.apache.ignite.internal.processors.query.h2.sql;
 
 import java.util.ArrayList;
+import org.apache.ignite.internal.util.typedef.F;
+import org.apache.ignite.internal.util.typedef.internal.SB;
 import org.h2.command.Parser;
 
 /**
@@ -48,6 +50,8 @@ public class GridSqlAlias extends GridSqlElement {
 
         addChild(expr);
 
+        assert !F.isEmpty(alias): alias;
+
         this.useAs = useAs;
         this.alias = alias;
     }
@@ -67,7 +71,21 @@ public class GridSqlAlias extends GridSqlElement {
 
     /** {@inheritDoc} */
     @Override public String getSQL() {
-        return child(0).getSQL() + (useAs ? " AS " : " ") + Parser.quoteIdentifier(alias);
+        SB b = new SB();
+
+        GridSqlAst child = child(0);
+
+        boolean tbl = child instanceof GridSqlTable;
+
+        b.a(tbl ? ((GridSqlTable)child).getBeforeAliasSql() : child.getSQL());
+
+        b.a(useAs ? " AS " : " ");
+        b.a(Parser.quoteIdentifier(alias));
+
+        if (tbl)
+            b.a(((GridSqlTable)child).getAfterAliasSQL());
+
+        return b.toString();
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/ignite/blob/457c5515/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/sql/GridSqlQueryParser.java
----------------------------------------------------------------------
diff --git 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
index 199a157..13d4237 100644
--- 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
@@ -406,6 +406,10 @@ public class GridSqlQueryParser {
         if (res == null) {
             res = parseTable(filter.getTable());
 
+            // Setup index hints.
+            if (res instanceof GridSqlTable && filter.getIndexHints() != null)
+                ((GridSqlTable)res).useIndexes(new ArrayList<>(filter.getIndexHints().getAllowedIndexes()));
+
             String alias = ALIAS.get(filter);
 
             if (alias != null)

http://git-wip-us.apache.org/repos/asf/ignite/blob/457c5515/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/sql/GridSqlTable.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/sql/GridSqlTable.java
b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/sql/GridSqlTable.java
index 57ca4df..e531254 100644
--- a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/sql/GridSqlTable.java
+++ b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/sql/GridSqlTable.java
@@ -18,7 +18,9 @@
 package org.apache.ignite.internal.processors.query.h2.sql;
 
 import java.util.Collections;
+import java.util.List;
 import org.apache.ignite.internal.processors.query.h2.opt.GridH2Table;
+import org.apache.ignite.internal.util.typedef.internal.SB;
 import org.h2.command.Parser;
 import org.h2.table.Table;
 import org.jetbrains.annotations.Nullable;
@@ -36,6 +38,9 @@ public class GridSqlTable extends GridSqlElement {
     /** */
     private final GridH2Table tbl;
 
+    /** */
+    private List<String> useIndexes;
+
     /**
      * @param schema Schema.
      * @param tblName Table name.
@@ -70,6 +75,13 @@ public class GridSqlTable extends GridSqlElement {
 
     /** {@inheritDoc} */
     @Override public String getSQL() {
+        return getBeforeAliasSql() + getAfterAliasSQL();
+    }
+
+    /**
+     * @return SQL for the table before alias.
+     */
+    public String getBeforeAliasSql() {
         if (schema == null)
             return Parser.quoteIdentifier(tblName);
 
@@ -77,6 +89,40 @@ public class GridSqlTable extends GridSqlElement {
     }
 
     /**
+     * @return SQL for the table after alias.
+     */
+    public String getAfterAliasSQL() {
+        if (useIndexes == null)
+            return "";
+
+        SB b = new SB();
+
+        b.a(" USE INDEX (");
+
+        boolean first = true;
+
+        for (String idx : useIndexes) {
+            if (first)
+                first = false;
+            else
+                b.a(", ");
+
+            b.a(Parser.quoteIdentifier(idx));
+        }
+
+        b.a(')');
+
+        return b.toString();
+    }
+
+    /**
+     * @param useIndexes List of indexes.
+     */
+    public void useIndexes(List<String> useIndexes) {
+        this.useIndexes = useIndexes;
+    }
+
+    /**
      * @return Schema.
      */
     public String schema() {

http://git-wip-us.apache.org/repos/asf/ignite/blob/457c5515/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridMergeIndex.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridMergeIndex.java
b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridMergeIndex.java
index 27622bb..86601cd 100644
--- a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridMergeIndex.java
+++ b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridMergeIndex.java
@@ -46,6 +46,7 @@ import org.h2.index.IndexType;
 import org.h2.message.DbException;
 import org.h2.result.Row;
 import org.h2.result.SearchRow;
+import org.h2.table.Column;
 import org.h2.table.IndexColumn;
 import org.h2.value.Value;
 import org.jetbrains.annotations.Nullable;

http://git-wip-us.apache.org/repos/asf/ignite/blob/457c5515/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridMergeIndexSorted.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridMergeIndexSorted.java
b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridMergeIndexSorted.java
index 361bb2d..f2d9de4 100644
--- a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridMergeIndexSorted.java
+++ b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridMergeIndexSorted.java
@@ -20,6 +20,7 @@ package org.apache.ignite.internal.processors.query.h2.twostep;
 import java.util.Arrays;
 import java.util.Collection;
 import java.util.Comparator;
+import java.util.HashSet;
 import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
@@ -41,6 +42,7 @@ import org.h2.index.IndexType;
 import org.h2.result.Row;
 import org.h2.result.SearchRow;
 import org.h2.result.SortOrder;
+import org.h2.table.Column;
 import org.h2.table.IndexColumn;
 import org.h2.table.TableFilter;
 import org.h2.value.Value;
@@ -184,8 +186,8 @@ public final class GridMergeIndexSorted extends GridMergeIndex {
     }
 
     /** {@inheritDoc} */
-    @Override public double getCost(Session ses, int[] masks, TableFilter[] filters, int
filter, SortOrder sortOrder) {
-        return getCostRangeIndex(masks, getRowCountApproximation(), filters, filter, sortOrder,
false);
+    @Override public double getCost(Session ses, int[] masks, TableFilter[] filters, int
filter, SortOrder sortOrder, HashSet<Column> allColumnsSet) {
+        return getCostRangeIndex(masks, getRowCountApproximation(), filters, filter, sortOrder,
false, allColumnsSet);
     }
 
     /** {@inheritDoc} */

http://git-wip-us.apache.org/repos/asf/ignite/blob/457c5515/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridMergeIndexUnsorted.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridMergeIndexUnsorted.java
b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridMergeIndexUnsorted.java
index 430a687..c53b58f 100644
--- a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridMergeIndexUnsorted.java
+++ b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridMergeIndexUnsorted.java
@@ -19,6 +19,7 @@ package org.apache.ignite.internal.processors.query.h2.twostep;
 
 import java.util.Collection;
 import java.util.Collections;
+import java.util.HashSet;
 import java.util.Iterator;
 import java.util.List;
 import java.util.concurrent.LinkedBlockingQueue;
@@ -33,6 +34,7 @@ import org.h2.index.IndexType;
 import org.h2.result.Row;
 import org.h2.result.SearchRow;
 import org.h2.result.SortOrder;
+import org.h2.table.Column;
 import org.h2.table.IndexColumn;
 import org.h2.table.TableFilter;
 import org.h2.value.Value;
@@ -116,8 +118,8 @@ public final class GridMergeIndexUnsorted extends GridMergeIndex {
     }
 
     /** {@inheritDoc} */
-    @Override public double getCost(Session ses, int[] masks, TableFilter[] filters, int
filter, SortOrder sortOrder) {
-        return getCostRangeIndex(masks, getRowCountApproximation(), filters, filter, sortOrder,
true);
+    @Override public double getCost(Session ses, int[] masks, TableFilter[] filters, int
filter, SortOrder sortOrder, HashSet<Column> allColumnsSet) {
+        return getCostRangeIndex(masks, getRowCountApproximation(), filters, filter, sortOrder,
true, allColumnsSet);
     }
 
     /** {@inheritDoc} */

http://git-wip-us.apache.org/repos/asf/ignite/blob/457c5515/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridMergeTable.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridMergeTable.java
b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridMergeTable.java
index f7495c0..681917f 100644
--- a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridMergeTable.java
+++ b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridMergeTable.java
@@ -18,6 +18,8 @@
 package org.apache.ignite.internal.processors.query.h2.twostep;
 
 import java.util.ArrayList;
+import java.util.HashSet;
+
 import org.apache.ignite.internal.processors.query.h2.opt.GridH2ScanIndex;
 import org.apache.ignite.internal.util.typedef.F;
 import org.h2.command.ddl.CreateTableData;
@@ -27,9 +29,11 @@ import org.h2.index.IndexType;
 import org.h2.message.DbException;
 import org.h2.result.Row;
 import org.h2.result.SortOrder;
+import org.h2.table.Column;
 import org.h2.table.IndexColumn;
 import org.h2.table.TableBase;
 import org.h2.table.TableFilter;
+import org.h2.table.TableType;
 
 /**
  * Merge table for distributed queries.
@@ -111,8 +115,8 @@ public class GridMergeTable extends TableBase {
     }
 
     /** {@inheritDoc} */
-    @Override public String getTableType() {
-        return EXTERNAL_TABLE_ENGINE;
+    @Override public TableType getTableType() {
+        return TableType.EXTERNAL_TABLE_ENGINE;
     }
 
     /** {@inheritDoc} */
@@ -188,10 +192,10 @@ public class GridMergeTable extends TableBase {
 
         /** {@inheritDoc} */
         @Override public double getCost(Session session, int[] masks, TableFilter[] filters,
int filter,
-            SortOrder sortOrder) {
+            SortOrder sortOrder, HashSet<Column> allColumnsSet) {
             long rows = getRowCountApproximation();
 
-            return getCostRangeIndex(masks, rows, filters, filter, sortOrder, true);
+            return getCostRangeIndex(masks, rows, filters, filter, sortOrder, true, allColumnsSet);
         }
     }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/457c5515/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridThreadLocalTable.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridThreadLocalTable.java
b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridThreadLocalTable.java
index d46fb2f..9bbb9b4 100644
--- a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridThreadLocalTable.java
+++ b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridThreadLocalTable.java
@@ -37,6 +37,7 @@ import org.h2.table.IndexColumn;
 import org.h2.table.PlanItem;
 import org.h2.table.Table;
 import org.h2.table.TableFilter;
+import org.h2.table.TableType;
 import org.h2.value.Value;
 
 /**
@@ -91,8 +92,8 @@ public class GridThreadLocalTable extends Table {
 
     /** {@inheritDoc} */
     @Override public PlanItem getBestPlanItem(Session session, int[] masks, TableFilter[]
filters, int filter,
-        SortOrder sortOrder) {
-        return innerTable().getBestPlanItem(session, masks, filters, filter, sortOrder);
+        SortOrder sortOrder, HashSet<Column> cols) {
+        return innerTable().getBestPlanItem(session, masks, filters, filter, sortOrder, cols);
     }
 
     /** {@inheritDoc} */
@@ -177,8 +178,8 @@ public class GridThreadLocalTable extends Table {
     }
 
     /** {@inheritDoc} */
-    @Override public String getTableType() {
-        return EXTERNAL_TABLE_ENGINE;
+    @Override public TableType getTableType() {
+        return TableType.EXTERNAL_TABLE_ENGINE;
     }
 
     /** {@inheritDoc} */

http://git-wip-us.apache.org/repos/asf/ignite/blob/457c5515/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/IgniteSqlSplitterSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/IgniteSqlSplitterSelfTest.java
b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/IgniteSqlSplitterSelfTest.java
index 2a03796..4578171 100644
--- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/IgniteSqlSplitterSelfTest.java
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/IgniteSqlSplitterSelfTest.java
@@ -476,6 +476,38 @@ public class IgniteSqlSplitterSelfTest extends GridCommonAbstractTest
{
     }
 
     /**
+     */
+    public void testUseIndexHints() {
+        CacheConfiguration ccfg = cacheConfig("pers", true,
+            Integer.class, Person2.class);
+
+        IgniteCache<Integer, Person2> c = ignite(0).getOrCreateCache(ccfg);
+
+        try {
+            String select = "select 1 from Person2 use index (\"PERSON2_ORGID_IDX\") where
name = '' and orgId = 1";
+
+            String plan = c.query(new SqlFieldsQuery("explain " + select)).getAll().toString();
+
+            X.println("Plan: \n" + plan);
+
+            assertTrue(plan.contains("USE INDEX (PERSON2_ORGID_IDX)"));
+            assertTrue(plan.contains("/* \"pers\".PERSON2_ORGID_IDX:"));
+
+            select = "select 1 from Person2 use index (\"PERSON2_NAME_IDX\") where name =
'' and orgId = 1";
+
+            plan = c.query(new SqlFieldsQuery("explain " + select)).getAll().toString();
+
+            X.println("Plan: \n" + plan);
+
+            assertTrue(plan.contains("USE INDEX (PERSON2_NAME_IDX)"));
+            assertTrue(plan.contains("/* \"pers\".PERSON2_NAME_IDX:"));
+        }
+        finally {
+            c.destroy();
+        }
+    }
+
+    /**
      * @throws Exception If failed.
      */
     public void testDistributedJoins() throws Exception {
@@ -1917,7 +1949,7 @@ public class IgniteSqlSplitterSelfTest extends GridCommonAbstractTest
{
         int orgId;
 
         /** */
-        @QuerySqlField
+        @QuerySqlField(index = true)
         String name;
 
         /**

http://git-wip-us.apache.org/repos/asf/ignite/blob/457c5515/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/h2/database/InlineIndexHelperTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/h2/database/InlineIndexHelperTest.java
b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/h2/database/InlineIndexHelperTest.java
index f34deae..0317672 100644
--- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/h2/database/InlineIndexHelperTest.java
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/h2/database/InlineIndexHelperTest.java
@@ -46,7 +46,6 @@ import org.h2.value.ValueShort;
 import org.h2.value.ValueString;
 import org.h2.value.ValueTime;
 import org.h2.value.ValueTimestamp;
-import org.h2.value.ValueTimestampUtc;
 import org.h2.value.ValueUuid;
 
 /**
@@ -286,13 +285,6 @@ public class InlineIndexHelperTest extends TestCase {
     }
 
     /** */
-    public void testTimestampUTC() throws Exception {
-        testPutGet(ValueTimestampUtc.fromMillis(System.currentTimeMillis()),
-            ValueTimestampUtc.fromMillis(System.currentTimeMillis() + 100),
-            ValueTimestampUtc.fromMillis(System.currentTimeMillis() + 200));
-    }
-
-    /** */
     public void testUUID() throws Exception {
         testPutGet(ValueUuid.get(UUID.randomUUID().toString()),
             ValueUuid.get(UUID.randomUUID().toString()),

http://git-wip-us.apache.org/repos/asf/ignite/blob/457c5515/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/h2/sql/GridQueryParsingTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/h2/sql/GridQueryParsingTest.java
b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/h2/sql/GridQueryParsingTest.java
index 631adeb..2085c9f 100644
--- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/h2/sql/GridQueryParsingTest.java
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/h2/sql/GridQueryParsingTest.java
@@ -169,10 +169,10 @@ public class GridQueryParsingTest extends GridCommonAbstractTest {
         checkQuery("select * from table0('aaa', 100)");
         checkQuery("select * from table0('aaa', 100) t0");
         checkQuery("select x.a, y.b from table0('aaa', 100) x natural join table0('bbb',
100) y");
-        checkQuery("select * from table0('aaa', 100) x join table0('bbb', 100) y on x.a=y.a
and x.b = 'bbb'");
-        checkQuery("select * from table0('aaa', 100) x left join table0('bbb', 100) y on
x.a=y.a and x.b = 'bbb'");
-        checkQuery("select * from table0('aaa', 100) x left join table0('bbb', 100) y on
x.a=y.a where x.b = 'bbb'");
-        checkQuery("select * from table0('aaa', 100) x left join table0('bbb', 100) y where
x.b = 'bbb'");
+        checkQuery("select * from table0('aaa', 100) x join table0('bbb', 100) y on x.a=y.a
and x.b = 1");
+        checkQuery("select * from table0('aaa', 100) x left join table0('bbb', 100) y on
x.a=y.a and x.b = 1");
+        checkQuery("select * from table0('aaa', 100) x left join table0('bbb', 100) y on
x.a=y.a where x.b = 1");
+        checkQuery("select * from table0('aaa', 100) x left join table0('bbb', 100) y where
x.b = 1");
 
         checkQuery("select avg(old) from Person left join sch2.Address on Person.addrId =
Address.id " +
             "where lower(Address.street) = lower(?)");
@@ -314,6 +314,21 @@ public class GridQueryParsingTest extends GridCommonAbstractTest {
     }
 
     /**
+     * @throws Exception If failed.
+     */
+    public void testUseIndexHints() throws Exception {
+        checkQuery("select * from Person use index (\"PERSON_NAME_IDX\")");
+        checkQuery("select * from Person use index (\"PERSON_PARENTNAME_IDX\")");
+        checkQuery("select * from Person use index (\"PERSON_NAME_IDX\", \"PERSON_PARENTNAME_IDX\")");
+        checkQuery("select * from Person use index ()");
+
+        checkQuery("select * from Person p use index (\"PERSON_NAME_IDX\")");
+        checkQuery("select * from Person p use index (\"PERSON_PARENTNAME_IDX\")");
+        checkQuery("select * from Person p use index (\"PERSON_NAME_IDX\", \"PERSON_PARENTNAME_IDX\")");
+        checkQuery("select * from Person p use index ()");
+    }
+
+    /**
      * Query AST transformation heavily depends on this behavior.
      *
      * @throws Exception If failed.
@@ -383,7 +398,7 @@ public class GridQueryParsingTest extends GridCommonAbstractTest {
         checkQuery("merge into Person(date, old, name, parentName, addrId) values " +
             "(TRUNCATE(TIMESTAMP '2015-12-31 23:59:59'), POWER(3,12), NULL, DEFAULT, DEFAULT)");
         checkQuery("merge into Person(old, name) select ASCII(parentName), INSERT(parentName,
4, 4, 'Max') from " +
-            "Person where date='20110312'");
+            "Person where date='2011-03-12'");
 
         /* Subqueries. */
         checkQuery("merge into Person(old, name) select old, parentName from Person");
@@ -423,7 +438,7 @@ public class GridQueryParsingTest extends GridCommonAbstractTest {
         checkQuery("insert into Person SET name = CONCAT('Fyodor', null, UPPER(CONCAT(SQRT(?),
'dostoevsky'))), old = " +
             "select (5, 6)");
         checkQuery("insert into Person(old, name) select ASCII(parentName), INSERT(parentName,
4, 4, 'Max') from " +
-            "Person where date='20110312'");
+            "Person where date='2011-03-12'");
 
         /* Subqueries. */
         checkQuery("insert into Person(old, name) select old, parentName from Person");
@@ -491,7 +506,7 @@ public class GridQueryParsingTest extends GridCommonAbstractTest {
 
         // Schemas for index and table must match
         assertParseThrows("create index if not exists sch2.idx on sch1.Person (name)",
-            DbException.class, "Schema name must match [90080-191]");
+            DbException.class, "Schema name must match [90080-194]");
 
         assertParseThrows("create hash index if not exists idx on Person (name)",
             IgniteSQLException.class, "Only SPATIAL modifier is supported for CREATE INDEX");

http://git-wip-us.apache.org/repos/asf/ignite/blob/457c5515/parent/pom.xml
----------------------------------------------------------------------
diff --git a/parent/pom.xml b/parent/pom.xml
index 74e8cf5..cb638e1 100644
--- a/parent/pom.xml
+++ b/parent/pom.xml
@@ -71,7 +71,7 @@
         <guava.version>18.0</guava.version>
         <guava14.version>14.0.1</guava14.version>
         <guava16.version>16.0.1</guava16.version>
-        <h2.version>1.4.191</h2.version>
+        <h2.version>1.4.194</h2.version>
         <httpclient.version>4.5.1</httpclient.version>
         <httpcore.version>4.4.3</httpcore.version>
         <jackson.version>1.9.13</jackson.version>


Mime
View raw message