[jira] [Created] (IGNITE-14602) Calcite engine. Wrong string representation of dates outside standard ISO range

2021-04-20 Thread Konstantin Orlov (Jira)
Konstantin Orlov created IGNITE-14602:
-

 Summary: Calcite engine. Wrong string representation of dates 
outside standard ISO range 
 Key: IGNITE-14602
 URL: https://issues.apache.org/jira/browse/IGNITE-14602
 Project: Ignite
  Issue Type: Bug
  Components: sql
Reporter: Konstantin Orlov


Subj.

Affected tests:

{{src/test/sql/types/date/date_parsing.test_ignored}}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Created] (IGNITE-14597) Calcite engine. Exception when using FIRST

2021-04-20 Thread Konstantin Orlov (Jira)
Konstantin Orlov created IGNITE-14597:
-

 Summary: Calcite engine. Exception when using FIRST
 Key: IGNITE-14597
 URL: https://issues.apache.org/jira/browse/IGNITE-14597
 Project: Ignite
  Issue Type: Bug
  Components: sql
Reporter: Konstantin Orlov


Exception is thrown when running a query {{SELECT FIRST(NULL::DECIMAL)}}


{code:java}
class org.apache.ignite.IgniteException: Error at: decimal_aggregates.test:10. 
sql: SELECT FIRST(NULL::DECIMAL)

at 
org.apache.ignite.internal.processors.query.calcite.logical.SqlScriptRunner$Query.execute(SqlScriptRunner.java:518)
at 
org.apache.ignite.internal.processors.query.calcite.logical.SqlScriptRunner.run(SqlScriptRunner.java:93)
at 
org.apache.ignite.internal.processors.query.calcite.logical.ScriptTestRunner$1.run(ScriptTestRunner.java:219)
at java.lang.Thread.run(Thread.java:748)
Caused by: class 
org.apache.ignite.internal.processors.query.IgniteSQLException: Failed to plan 
query.
at 
org.apache.ignite.internal.processors.query.calcite.exec.ExecutionServiceImpl.prepareQuery(ExecutionServiceImpl.java:541)
at 
org.apache.ignite.internal.processors.query.calcite.prepare.QueryPlanCacheImpl.queryPlan(QueryPlanCacheImpl.java:84)
at 
org.apache.ignite.internal.processors.query.calcite.exec.ExecutionServiceImpl.executeQuery(ExecutionServiceImpl.java:398)
at 
org.apache.ignite.internal.processors.query.calcite.CalciteQueryProcessor.query(CalciteQueryProcessor.java:246)
at 
org.apache.ignite.internal.processors.query.calcite.logical.SqlScriptRunner.sql(SqlScriptRunner.java:111)
at 
org.apache.ignite.internal.processors.query.calcite.logical.SqlScriptRunner.access$600(SqlScriptRunner.java:51)
at 
org.apache.ignite.internal.processors.query.calcite.logical.SqlScriptRunner$Query.execute(SqlScriptRunner.java:513)
... 3 more
Caused by: org.apache.calcite.runtime.CalciteContextException: From line 1, 
column 8 to line 1, column 27: Function 'FIRST(NULL :: DECIMAL, 0)' can only be 
used in MATCH_RECOGNIZE
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at 
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at 
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at 
org.apache.calcite.runtime.Resources$ExInstWithCause.ex(Resources.java:467)
at org.apache.calcite.sql.SqlUtil.newContextException(SqlUtil.java:883)
at org.apache.calcite.sql.SqlUtil.newContextException(SqlUtil.java:868)
at 
org.apache.calcite.sql.validate.SqlValidatorImpl.newValidationError(SqlValidatorImpl.java:5043)
at 
org.apache.calcite.sql.validate.SqlValidatorImpl.validateCall(SqlValidatorImpl.java:5574)
at 
org.apache.ignite.internal.processors.query.calcite.prepare.IgniteSqlValidator.validateCall(IgniteSqlValidator.java:230)
at org.apache.calcite.sql.SqlCall.validate(SqlCall.java:116)
at org.apache.calcite.sql.SqlNode.validateExpr(SqlNode.java:273)
at 
org.apache.calcite.sql.validate.SqlValidatorImpl.validateExpr(SqlValidatorImpl.java:4259)
at 
org.apache.calcite.sql.validate.SqlValidatorImpl.validateSelectList(SqlValidatorImpl.java:4234)
at 
org.apache.calcite.sql.validate.SqlValidatorImpl.validateSelect(SqlValidatorImpl.java:3474)
at 
org.apache.ignite.internal.processors.query.calcite.prepare.IgniteSqlValidator.validateSelect(IgniteSqlValidator.java:176)
at 
org.apache.calcite.sql.validate.SelectNamespace.validateImpl(SelectNamespace.java:60)
at 
org.apache.calcite.sql.validate.AbstractNamespace.validate(AbstractNamespace.java:84)
at 
org.apache.calcite.sql.validate.SqlValidatorImpl.validateNamespace(SqlValidatorImpl.java:1067)
at 
org.apache.ignite.internal.processors.query.calcite.prepare.IgniteSqlValidator.validateNamespace(IgniteSqlValidator.java:190)
at 
org.apache.calcite.sql.validate.SqlValidatorImpl.validateQuery(SqlValidatorImpl.java:1041)
at org.apache.calcite.sql.SqlSelect.validate(SqlSelect.java:232)
at 
org.apache.calcite.sql.validate.SqlValidatorImpl.validateScopedExpression(SqlValidatorImpl.java:1016)
at 
org.apache.calcite.sql.validate.SqlValidatorImpl.validate(SqlValidatorImpl.java:724)
at 
org.apache.ignite.internal.processors.query.calcite.prepare.IgnitePlanner.validateAndGetTypeMetadata(IgnitePlanner.java:202)
at 
org.apache.ignite.internal.processors.query.calcite.exec.ExecutionServiceImpl.prepareQuery(ExecutionServiceImpl.java:587)
at 
org.apache.ignite.internal.processors.query.calcite.exec.ExecutionServiceImpl.prepareSingle(ExecutionServiceImpl.java:562)
at 

[jira] [Created] (IGNITE-14596) Calcite engine. Support for function TYPEOF

2021-04-20 Thread Konstantin Orlov (Jira)
Konstantin Orlov created IGNITE-14596:
-

 Summary: Calcite engine. Support for function TYPEOF
 Key: IGNITE-14596
 URL: https://issues.apache.org/jira/browse/IGNITE-14596
 Project: Ignite
  Issue Type: Improvement
  Components: sql
Reporter: Konstantin Orlov


Currently a function TYPEOF is not supported.

Affected tests:
{{src/test/sql/types/decimal/decimal_aggregates.test_ignored}}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Created] (IGNITE-14590) Calcite engine. Sort out the types/decimal and types/string directories

2021-04-19 Thread Konstantin Orlov (Jira)
Konstantin Orlov created IGNITE-14590:
-

 Summary: Calcite engine. Sort out the types/decimal and 
types/string directories
 Key: IGNITE-14590
 URL: https://issues.apache.org/jira/browse/IGNITE-14590
 Project: Ignite
  Issue Type: Task
  Components: sql
Reporter: Konstantin Orlov
Assignee: Konstantin Orlov


We need to sort out results of the {{ScriptRunnerTestSuite}} to mute an every 
red test and file a ticket for related problems.

This ticket covers only two directories: {{types/decimal}} and {{types/string}}.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Created] (IGNITE-14589) Calcite engine. Numerous problem with type Decimal

2021-04-19 Thread Konstantin Orlov (Jira)
Konstantin Orlov created IGNITE-14589:
-

 Summary: Calcite engine. Numerous problem with type Decimal
 Key: IGNITE-14589
 URL: https://issues.apache.org/jira/browse/IGNITE-14589
 Project: Ignite
  Issue Type: Bug
  Components: sql
Reporter: Konstantin Orlov


There are numerous problem with a decimal types:
* very big numbers printed in scientific notation
* leading and trailing zeros are truncated when converting to string
* casting to precise scale is not working( {{select cast('0.01' as decimal(10, 
1)) * 10}} returns 0.1 instead of 0)

Affected tests:
{{src/test/sql/types/decimal}}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Created] (IGNITE-14555) Calcite engine. Create table from query result

2021-04-15 Thread Konstantin Orlov (Jira)
Konstantin Orlov created IGNITE-14555:
-

 Summary: Calcite engine. Create table from query result
 Key: IGNITE-14555
 URL: https://issues.apache.org/jira/browse/IGNITE-14555
 Project: Ignite
  Issue Type: Improvement
  Components: sql
Reporter: Konstantin Orlov


Provide ability to create table from the result of the query: {{CREATE TABLE 
my_tbl AS }}.

Affected tests:
{{modules/calcite/src/test/sql/types/decimal/decimal_aggregates.test_ignore}}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Created] (IGNITE-14554) Calcite engine. Provide ability to parse huge numeric literals

2021-04-15 Thread Konstantin Orlov (Jira)
Konstantin Orlov created IGNITE-14554:
-

 Summary: Calcite engine. Provide ability to parse huge numeric 
literals
 Key: IGNITE-14554
 URL: https://issues.apache.org/jira/browse/IGNITE-14554
 Project: Ignite
  Issue Type: Improvement
  Components: sql
Reporter: Konstantin Orlov


Currently literals like this {{17014118346046923173168730371588410572}} can't 
pass validation because they overflow range of long values.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Created] (IGNITE-14553) Calcite engine. Duplicated result on insert

2021-04-15 Thread Konstantin Orlov (Jira)
Konstantin Orlov created IGNITE-14553:
-

 Summary: Calcite engine. Duplicated result on insert
 Key: IGNITE-14553
 URL: https://issues.apache.org/jira/browse/IGNITE-14553
 Project: Ignite
  Issue Type: Bug
  Components: sql
Reporter: Konstantin Orlov


Please see the test 
{{modules/calcite/src/test/sql/types/string/test_scan_big_varchar.test_ignore}}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Created] (IGNITE-14552) Calcite engine. Alias for function CHARACTER_LENGTH

2021-04-15 Thread Konstantin Orlov (Jira)
Konstantin Orlov created IGNITE-14552:
-

 Summary: Calcite engine. Alias for function CHARACTER_LENGTH
 Key: IGNITE-14552
 URL: https://issues.apache.org/jira/browse/IGNITE-14552
 Project: Ignite
  Issue Type: Improvement
  Components: sql
Reporter: Konstantin Orlov


Currently the function to get the length of the string is named 
{{CHARACTER_LENGTH}}. It would be nice to have an alias {{LENGTH}} for this.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Created] (IGNITE-14549) Calcite. ORDER BY column not from SELECT LIST

2021-04-15 Thread Konstantin Orlov (Jira)
Konstantin Orlov created IGNITE-14549:
-

 Summary: Calcite. ORDER BY column not from SELECT LIST
 Key: IGNITE-14549
 URL: https://issues.apache.org/jira/browse/IGNITE-14549
 Project: Ignite
  Issue Type: Bug
Reporter: Konstantin Orlov
Assignee: Konstantin Orlov


Currently queries with sorting by a column not presented in select list are 
failed during planning.

{{select col1 from my_table order by col2}}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Created] (IGNITE-14281) Calcite. Colocated tables considered non colocated

2021-03-04 Thread Konstantin Orlov (Jira)
Konstantin Orlov created IGNITE-14281:
-

 Summary: Calcite. Colocated tables considered non colocated
 Key: IGNITE-14281
 URL: https://issues.apache.org/jira/browse/IGNITE-14281
 Project: Ignite
  Issue Type: Bug
  Components: sql
Reporter: Konstantin Orlov
Assignee: Konstantin Orlov


Currently distribution trait for replicated cache is built over 0th column 
which is _KEY column. Because of this a colocated join is considered 
non-colocated until _KEY columns is not used explicitly as join predicate. Need 
to fix this.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Created] (IGNITE-14277) Calcite.

2021-03-03 Thread Konstantin Orlov (Jira)
Konstantin Orlov created IGNITE-14277:
-

 Summary: Calcite. 
 Key: IGNITE-14277
 URL: https://issues.apache.org/jira/browse/IGNITE-14277
 Project: Ignite
  Issue Type: Improvement
  Components: sql
Reporter: Konstantin Orlov


Currently SqlToRelConverter rewrites queries with IN predicate into semi-join 
but without actually using semi-join. The resulting plan includes two joins and 
several aggregates over IN argument list to calculate some sort of indicators. 
This plan is quite cumbersome, it contains a lot of nodes, thus boost a search 
space.
As workaround this optimization was disabled by increasing inSubQueryThreshold 
to a MAX_INT value.

But a safer solution would be to rewrite the IN predicate as a true semi-join, 
or better yet, an inner join. To achieve this, we need to convert the list of 
values to an inline table with only single values as the left shoulder of the 
inner join, and place the original table as the right shoulder. Thus, we could 
take advantage of the Indexed Nested Loop in case there is an index on a column 
that is part of the IN predicate.

 

Starting point for this ticket is 
{{org.apache.calcite.sql2rel.SqlToRelConverter#substituteSubQuery}}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Created] (IGNITE-14034) Calcite integration. indexCondition refactoring

2021-01-22 Thread Konstantin Orlov (Jira)
Konstantin Orlov created IGNITE-14034:
-

 Summary: Calcite integration. indexCondition refactoring
 Key: IGNITE-14034
 URL: https://issues.apache.org/jira/browse/IGNITE-14034
 Project: Ignite
  Issue Type: Improvement
  Components: sql
Reporter: Konstantin Orlov


Currently IndexCondition is quite cumbersome and hard to understand. The 
difference between bounds and conditions is unclear as well as unclear what 
should be used to estimate a selectivity and what should be used to estimate a 
self cost.

Thus I suggest to change it in a follow way:
 * remove [lower|upper]Cond
 * bounds remains as is
 * self cost estimation of an AbstractIndex should be calculated with regard to 
bounds
 * selectivity should be calculated with regards to whole condition that is 
member of ProjectableFilterableTableScan



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Created] (IGNITE-13973) Calcite integration. Query get frozen if assertion error was thrown

2021-01-11 Thread Konstantin Orlov (Jira)
Konstantin Orlov created IGNITE-13973:
-

 Summary: Calcite integration. Query get frozen if assertion error 
was thrown
 Key: IGNITE-13973
 URL: https://issues.apache.org/jira/browse/IGNITE-13973
 Project: Ignite
  Issue Type: Bug
  Components: sql
Reporter: Konstantin Orlov


Need to fix the issue and verify that assertion error on any stage of query 
planning/execution (this includes fragment splitting phase) doesn't lead to 
freezes.

Mentioned problem could be reproduced for example as follow:
1) place fake {{assert false}} inside {{IgniteMergeJoin(RelInput input)}}
2) run {{CalciteQueryProcessorTest.query2()}}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Created] (IGNITE-13964) Query cancellation freezes on local lazy queries

2021-01-11 Thread Konstantin Orlov (Jira)
Konstantin Orlov created IGNITE-13964:
-

 Summary: Query cancellation freezes on local lazy queries
 Key: IGNITE-13964
 URL: https://issues.apache.org/jira/browse/IGNITE-13964
 Project: Ignite
  Issue Type: Bug
  Components: sql
Affects Versions: 2.9.1
Reporter: Konstantin Orlov
Assignee: Konstantin Orlov


The reason is a query cancellation that acquires an iterator's lock to check 
the availability of a next row and thus update a state of the cursor to prevent 
unnecessary request cancelation. But the lock is already held by a query thread 
to fetch a next page, so the cancellation is forced to wait till the page will 
be completely prefetched.

 



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Created] (IGNITE-13776) BPlus tree lock retries limit reached with sqlOnHeapCacheEnabled

2020-11-30 Thread Konstantin Orlov (Jira)
Konstantin Orlov created IGNITE-13776:
-

 Summary: BPlus tree lock retries limit reached with 
sqlOnHeapCacheEnabled
 Key: IGNITE-13776
 URL: https://issues.apache.org/jira/browse/IGNITE-13776
 Project: Ignite
  Issue Type: Bug
  Components: sql
Affects Versions: 2.9
Reporter: Konstantin Orlov
Assignee: Konstantin Orlov


Issue might be reproduced with sqlOnHeapCacheEnabled=true.

The following exception is thrown while streaming some data into caches with 
data streamer:
{code:java}
[2020-07-08 20:22:16,766][ERROR][data-streamer-stripe-0-#9][root] Critical 
system error detected. Will be handled accordingly to configured handler 
[hnd=StopNodeOrHaltFailureHandler [tryStop=false, timeout=0, 
super=AbstractFailureHandler [ignoredFailureTypes=UnmodifiableSet 
[SYSTEM_WORKER_BLOCKED, SYSTEM_CRITICAL_OPERATION_TIMEOUT]]], 
failureCtx=FailureContext [type=CRITICAL_ERROR, err=class 
o.a.i.IgniteCheckedException: Maximum number of retries 1000 reached for Put 
operation (the tree may be corrupted). Increase IGNITE_BPLUS_TREE_LOCK_RETRIES 
system property if you regularly see this message (current value is 1000).]]
class org.apache.ignite.IgniteCheckedException: Maximum number of retries 1000 
reached for Put operation (the tree may be corrupted). Increase 
IGNITE_BPLUS_TREE_LOCK_RETRIES system property if you regularly see this 
message (current value is 1000).
at 
org.apache.ignite.internal.processors.cache.persistence.tree.BPlusTree$Get.checkLockRetry(BPlusTree.java:3090)
at 
org.apache.ignite.internal.processors.cache.persistence.tree.BPlusTree$Put.checkLockRetry(BPlusTree.java:3887)
at 
org.apache.ignite.internal.processors.cache.persistence.tree.BPlusTree.putDown(BPlusTree.java:2771)
at 
org.apache.ignite.internal.processors.cache.persistence.tree.BPlusTree.doPut(BPlusTree.java:2413)
at 
org.apache.ignite.internal.processors.cache.persistence.tree.BPlusTree.putx(BPlusTree.java:2393)
at 
org.apache.ignite.internal.processors.query.h2.database.H2TreeIndex.putx(H2TreeIndex.java:437)
at 
org.apache.ignite.internal.processors.query.h2.opt.GridH2Table.update(GridH2Table.java:757)
at 
org.apache.ignite.internal.processors.query.h2.IgniteH2Indexing.store(IgniteH2Indexing.java:379)
at 
org.apache.ignite.internal.processors.query.GridQueryProcessor.store(GridQueryProcessor.java:2187)
at 
org.apache.ignite.internal.processors.cache.query.GridCacheQueryManager.store(GridCacheQueryManager.java:406)
at 
org.apache.ignite.internal.processors.cache.IgniteCacheOffheapManagerImpl$CacheDataStoreImpl.finishUpdate(IgniteCacheOffheapManagerImpl.java:2561)
at 
org.apache.ignite.internal.processors.cache.IgniteCacheOffheapManagerImpl$CacheDataStoreImpl.invoke0(IgniteCacheOffheapManagerImpl.java:1670)
at 
org.apache.ignite.internal.processors.cache.IgniteCacheOffheapManagerImpl$CacheDataStoreImpl.invoke(IgniteCacheOffheapManagerImpl.java:1645)
at 
org.apache.ignite.internal.processors.cache.persistence.GridCacheOffheapManager$GridCacheDataStore.invoke(GridCacheOffheapManager.java:2473)
at 
org.apache.ignite.internal.processors.cache.IgniteCacheOffheapManagerImpl.invoke(IgniteCacheOffheapManagerImpl.java:436)
at 
org.apache.ignite.internal.processors.cache.GridCacheMapEntry.innerUpdate(GridCacheMapEntry.java:2328)
at 
org.apache.ignite.internal.processors.cache.distributed.dht.atomic.GridDhtAtomicCache.updateSingle(GridDhtAtomicCache.java:2601)
at 
org.apache.ignite.internal.processors.cache.distributed.dht.atomic.GridDhtAtomicCache.update(GridDhtAtomicCache.java:2062)
at 
org.apache.ignite.internal.processors.cache.distributed.dht.atomic.GridDhtAtomicCache.updateAllAsyncInternal0(GridDhtAtomicCache.java:1879)
at 
org.apache.ignite.internal.processors.cache.distributed.dht.atomic.GridDhtAtomicCache.updateAllAsyncInternal(GridDhtAtomicCache.java:1686)
at 
org.apache.ignite.internal.processors.cache.distributed.dht.atomic.GridNearAtomicAbstractUpdateFuture.sendSingleRequest(GridNearAtomicAbstractUpdateFuture.java:299)
at 
org.apache.ignite.internal.processors.cache.distributed.dht.atomic.GridNearAtomicSingleUpdateFuture.map(GridNearAtomicSingleUpdateFuture.java:486)
at 
org.apache.ignite.internal.processors.cache.distributed.dht.atomic.GridNearAtomicSingleUpdateFuture.mapOnTopology(GridNearAtomicSingleUpdateFuture.java:446)
at 
org.apache.ignite.internal.processors.cache.distributed.dht.atomic.GridNearAtomicAbstractUpdateFuture.map(GridNearAtomicAbstractUpdateFuture.java:248)
at 
org.apache.ignite.internal.processors.cache.distributed.dht.atomic.GridDhtAtomicCache.update0(GridDhtAtomicCache.java:1172)
at 

[jira] [Created] (IGNITE-13166) Flaky H2RowCachePageEvictionTest and IgniteCacheQueryH2IndexingLeakTest tests

2020-06-19 Thread Konstantin Orlov (Jira)
Konstantin Orlov created IGNITE-13166:
-

 Summary: Flaky H2RowCachePageEvictionTest and 
IgniteCacheQueryH2IndexingLeakTest tests 
 Key: IGNITE-13166
 URL: https://issues.apache.org/jira/browse/IGNITE-13166
 Project: Ignite
  Issue Type: Task
Reporter: Konstantin Orlov
Assignee: Konstantin Orlov


Currently we have several tests on TC which considered flaky. Need to 
investigate and fix them.

 

[https://ci.ignite.apache.org/project.html?projectId=IgniteTests24Java8=-4422957309644246466=testDetails]

[https://ci.ignite.apache.org/project.html?projectId=IgniteTests24Java8=8791646325227962211=testDetails]

[https://ci.ignite.apache.org/project.html?projectId=IgniteTests24Java8=-7378154946319099847=testDetails]



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Created] (IGNITE-13075) NPE on request JDBC metadata

2020-05-26 Thread Konstantin Orlov (Jira)
Konstantin Orlov created IGNITE-13075:
-

 Summary: NPE on request JDBC metadata
 Key: IGNITE-13075
 URL: https://issues.apache.org/jira/browse/IGNITE-13075
 Project: Ignite
  Issue Type: Bug
  Components: sql
Reporter: Konstantin Orlov
Assignee: Konstantin Orlov


NPE occure when metadata is requested and there is a table created through java 
API like a
{code:java}
ignite.createCache(
new CacheConfiguration<>(DEFAULT_CACHE_NAME)
.setIndexedTypes(Integer.class, String.class)
);{code}
Error here:
{code:java}
[2020-05-26 
15:52:24,502][ERROR][client-connector-#264%thin.JdbcThinMetadataSelfTest0%][JdbcRequestHandler]
 Failed to get columns metadata [reqId=15, req=JdbcMetaColumnsRequest 
[schemaName=testCache, tblName=null, colName=null]][2020-05-26 
15:52:24,502][ERROR][client-connector-#264%thin.JdbcThinMetadataSelfTest0%][JdbcRequestHandler]
 Failed to get columns metadata [reqId=15, req=JdbcMetaColumnsRequest 
[schemaName=testCache, tblName=null, 
colName=null]]java.lang.NullPointerException at 
org.apache.ignite.internal.processors.query.h2.IgniteH2Indexing.lambda$null$10(IgniteH2Indexing.java:1902)
 at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193) 
at java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:175) at 
java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:175) at 
java.util.Spliterators$ArraySpliterator.forEachRemaining(Spliterators.java:948) 
at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:481) at 
java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471) at 
java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:151) 
at 
java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:174)
 at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) at 
java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:418) at 
java.util.stream.ReferencePipeline$7$1.accept(ReferencePipeline.java:270) at 
java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:175) at 
java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:175) at 
java.util.concurrent.ConcurrentHashMap$ValueSpliterator.forEachRemaining(ConcurrentHashMap.java:3566)
 at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:481) at 
java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471) at 
java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:151) 
at 
java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:174)
 at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) at 
java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:418) at 
org.apache.ignite.internal.processors.query.h2.IgniteH2Indexing.columnsInformation(IgniteH2Indexing.java:1910)
 at 
org.apache.ignite.internal.processors.odbc.jdbc.JdbcMetadataInfo.getColumnsMeta(JdbcMetadataInfo.java:180)
 at 
org.apache.ignite.internal.processors.odbc.jdbc.JdbcRequestHandler.getColumnsMeta(JdbcRequestHandler.java:1128)
 at 
org.apache.ignite.internal.processors.odbc.jdbc.JdbcRequestHandler.doHandle(JdbcRequestHandler.java:348)
 at 
org.apache.ignite.internal.processors.odbc.jdbc.JdbcRequestHandler.handle(JdbcRequestHandler.java:257)
 at 
org.apache.ignite.internal.processors.odbc.ClientListenerNioListener.onMessage(ClientListenerNioListener.java:200)
 at 
org.apache.ignite.internal.processors.odbc.ClientListenerNioListener.onMessage(ClientListenerNioListener.java:54)
 at 
org.apache.ignite.internal.util.nio.GridNioFilterChain$TailFilter.onMessageReceived(GridNioFilterChain.java:279)
 at 
org.apache.ignite.internal.util.nio.GridNioFilterAdapter.proceedMessageReceived(GridNioFilterAdapter.java:109)
 at 
org.apache.ignite.internal.util.nio.GridNioAsyncNotifyFilter$3.body(GridNioAsyncNotifyFilter.java:97)
 at org.apache.ignite.internal.util.worker.GridWorker.run(GridWorker.java:120) 
at 
org.apache.ignite.internal.util.worker.GridWorkerPool$1.run(GridWorkerPool.java:70)
 at 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) 
at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) 
at java.lang.Thread.run(Thread.java:748){code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Created] (IGNITE-13007) JDBC: Introduce feature flags for JDBC thin

2020-05-13 Thread Konstantin Orlov (Jira)
Konstantin Orlov created IGNITE-13007:
-

 Summary: JDBC: Introduce feature flags for JDBC thin
 Key: IGNITE-13007
 URL: https://issues.apache.org/jira/browse/IGNITE-13007
 Project: Ignite
  Issue Type: Improvement
  Components: sql
Reporter: Konstantin Orlov
Assignee: Konstantin Orlov


Motivation the same as for https://issues.apache.org/jira/browse/IGNITE-12853

The thin client & JDBC, ODBC have different protocol specific and may require 
implement different features.
Each client (thin cli, thin JDBC, ODBC) should have its own feature flags set.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Created] (IGNITE-13002) Supports user's java object by JDBC thin client

2020-05-12 Thread Konstantin Orlov (Jira)
Konstantin Orlov created IGNITE-13002:
-

 Summary: Supports user's java object by JDBC thin client
 Key: IGNITE-13002
 URL: https://issues.apache.org/jira/browse/IGNITE-13002
 Project: Ignite
  Issue Type: Improvement
  Components: sql
Reporter: Konstantin Orlov
Assignee: Konstantin Orlov


Now JDBC thin client doesn't support no-SQL types.
e.g.:
{{CREATE TABLE TEST (ID INT PRIMARY KEY, VAL OTHER)}}
{code}
PreparedStatement stmt = conn.prepareStatement("INSERT INTO TEST VALUES(?, ?)")
stmt.setInteger(1, 0);
stmt.setObject(2, new MyClass());
{code}

We have to support {{GridBinaryMarshaller}} for the JDBC thin client.




--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Created] (IGNITE-12688) Improve performance of index inline JAVA_OBJECT fields

2020-02-17 Thread Konstantin Orlov (Jira)
Konstantin Orlov created IGNITE-12688:
-

 Summary: Improve performance of index inline JAVA_OBJECT fields
 Key: IGNITE-12688
 URL: https://issues.apache.org/jira/browse/IGNITE-12688
 Project: Ignite
  Issue Type: Bug
Reporter: Konstantin Orlov
Assignee: Konstantin Orlov


Inline JAVA_OBJECT may be reason of performance drop on index creation.

The *root cause* is the low selectivity of current part of JAVA_OBJECT that is 
inlined.
Now first N bytes of binary view of object is placed into inline space of the 
index.
But the first offset where the two objects with the same type may be different 
is 8 (HASH_CODE_POS).
With default inline = 10 we NEVER inline it:
Inline format:
1 byte - type,
2 bytes - size
>> 7 bytes - data;

*My proposal:*
- For metapage v4 (BPlusMetaIO) add flag *inlineObjectHash*;
- use this flag to work in compatibility mode.
- inline ONLY hash for JAVA_OBJECT fields for new indexes;

Also this approach solves the inconsistent between comparison JAVA_OBJECT by 
inline and full value, because value comparator uses hash to compare object 
before compare byte arrays.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Created] (IGNITE-12687) Sqline throws unexpected exceptions on few specific arguments to !describe and !primarykeys

2020-02-17 Thread Konstantin Orlov (Jira)
Konstantin Orlov created IGNITE-12687:
-

 Summary: Sqline throws unexpected exceptions on few specific 
arguments to !describe and !primarykeys
 Key: IGNITE-12687
 URL: https://issues.apache.org/jira/browse/IGNITE-12687
 Project: Ignite
  Issue Type: Bug
Reporter: Konstantin Orlov
Assignee: Konstantin Orlov


%subj 

{noformat}
0: jdbc:ignite:thin://127.0.0.1/> !describe '
java.lang.StringIndexOutOfBoundsException: String index out of range: -1
at java.lang.String.substring(String.java:1967)
at sqlline.SqlLine.dequote(SqlLine.java:1322)
at sqlline.SqlLine.split(SqlLine.java:1335)
at sqlline.SqlLine.split(SqlLine.java:1154)
at 
sqlline.AbstractCommandHandler.matches(AbstractCommandHandler.java:65)
at sqlline.SqlLine.dispatch(SqlLine.java:774)
at sqlline.SqlLine.begin(SqlLine.java:668)
at sqlline.SqlLine.start(SqlLine.java:373)
at sqlline.SqlLine.main(SqlLine.java:265)
{noformat}

when at least one table was created, following command also fails:

{noformat}
0: jdbc:ignite:thin://127.0.0.1/> !describe ?
[17:19:31,763][SEVERE][client-connector-#110][JdbcRequestHandler] Failed to get 
columns metadata [reqId=108, req=JdbcMetaColumnsRequest [schemaName=null, 
tblName=?, colName=%]]
java.util.regex.PatternSyntaxException: Dangling meta character '?' near index 0
?
^
at java.util.regex.Pattern.error(Pattern.java:1955)
at java.util.regex.Pattern.sequence(Pattern.java:2123)
at java.util.regex.Pattern.expr(Pattern.java:1996)
at java.util.regex.Pattern.compile(Pattern.java:1696)
at java.util.regex.Pattern.(Pattern.java:1351)
at java.util.regex.Pattern.compile(Pattern.java:1028)
at java.util.regex.Pattern.matches(Pattern.java:1133)
at java.lang.String.matches(String.java:2121)
at 
org.apache.ignite.internal.processors.query.QueryUtils.matches(QueryUtils.java:1547)
at 
org.apache.ignite.internal.processors.odbc.jdbc.JdbcMetadataInfo.getColumnsMeta(JdbcMetadataInfo.java:170)
at 
org.apache.ignite.internal.processors.odbc.jdbc.JdbcRequestHandler.getColumnsMeta(JdbcRequestHandler.java:1089)
at 
org.apache.ignite.internal.processors.odbc.jdbc.JdbcRequestHandler.doHandle(JdbcRequestHandler.java:332)
at 
org.apache.ignite.internal.processors.odbc.jdbc.JdbcRequestHandler.handle(JdbcRequestHandler.java:241)
at 
org.apache.ignite.internal.processors.odbc.ClientListenerNioListener.onMessage(ClientListenerNioListener.java:180)
at 
org.apache.ignite.internal.processors.odbc.ClientListenerNioListener.onMessage(ClientListenerNioListener.java:47)
at 
org.apache.ignite.internal.util.nio.GridNioFilterChain$TailFilter.onMessageReceived(GridNioFilterChain.java:278)
at 
org.apache.ignite.internal.util.nio.GridNioFilterAdapter.proceedMessageReceived(GridNioFilterAdapter.java:108)
at 
org.apache.ignite.internal.util.nio.GridNioAsyncNotifyFilter$3.body(GridNioAsyncNotifyFilter.java:96)
at 
org.apache.ignite.internal.util.worker.GridWorker.run(GridWorker.java:119)
at 
org.apache.ignite.internal.util.worker.GridWorkerPool$1.run(GridWorkerPool.java:69)
at 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:748)
Error: Dangling meta character '?' near index 0
?
^ (state=5,code=1)

{noformat}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Created] (IGNITE-12678) GridLongList fails on add when created with explicit zero size

2020-02-13 Thread Konstantin Orlov (Jira)
Konstantin Orlov created IGNITE-12678:
-

 Summary: GridLongList fails on add when created with explicit zero 
size
 Key: IGNITE-12678
 URL: https://issues.apache.org/jira/browse/IGNITE-12678
 Project: Ignite
  Issue Type: Bug
  Components: data structures
Reporter: Konstantin Orlov






--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Created] (IGNITE-12677) Extend test coverage for GridLongList serialization

2020-02-13 Thread Konstantin Orlov (Jira)
Konstantin Orlov created IGNITE-12677:
-

 Summary: Extend test coverage for GridLongList serialization
 Key: IGNITE-12677
 URL: https://issues.apache.org/jira/browse/IGNITE-12677
 Project: Ignite
  Issue Type: Task
  Components: binary
Reporter: Konstantin Orlov
Assignee: Konstantin Orlov






--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Created] (IGNITE-12675) Binary types registered in two stages when entry processor is used

2020-02-13 Thread Konstantin Orlov (Jira)
Konstantin Orlov created IGNITE-12675:
-

 Summary: Binary types registered in two stages when entry 
processor is used
 Key: IGNITE-12675
 URL: https://issues.apache.org/jira/browse/IGNITE-12675
 Project: Ignite
  Issue Type: Bug
  Components: binary
Reporter: Konstantin Orlov


When you try to add new value with entry processor, binary type registration 
proceeded in two stages:
 - class registration
 - binary metadata registration

Perhaps it could be achieved by only one stage.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Created] (IGNITE-12674) Extend test coverage for binary types registration

2020-02-13 Thread Konstantin Orlov (Jira)
Konstantin Orlov created IGNITE-12674:
-

 Summary: Extend test coverage for binary types registration
 Key: IGNITE-12674
 URL: https://issues.apache.org/jira/browse/IGNITE-12674
 Project: Ignite
  Issue Type: Task
  Components: binary
Reporter: Konstantin Orlov
Assignee: Konstantin Orlov






--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Created] (IGNITE-12571) Statistics of query cache statements

2020-01-23 Thread Konstantin Orlov (Jira)
Konstantin Orlov created IGNITE-12571:
-

 Summary: Statistics of query cache statements
 Key: IGNITE-12571
 URL: https://issues.apache.org/jira/browse/IGNITE-12571
 Project: Ignite
  Issue Type: Bug
  Components: sql
Reporter: Konstantin Orlov
Assignee: Konstantin Orlov


We need to collect hit/miss statistics for the query cache.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Created] (IGNITE-12569) Can't set serialized enum to a BinaryObject's field

2020-01-22 Thread Konstantin Orlov (Jira)
Konstantin Orlov created IGNITE-12569:
-

 Summary: Can't set serialized enum to a BinaryObject's field
 Key: IGNITE-12569
 URL: https://issues.apache.org/jira/browse/IGNITE-12569
 Project: Ignite
  Issue Type: Bug
  Components: binary
Reporter: Konstantin Orlov
Assignee: Konstantin Orlov


The deserialization of the BinaryObject fails since a serialized representation 
of the enum was set to a field instead of the enum itself. Because of this 
issue there is no way to work with enums without a corresponding class.

Error message thrown during the deserialization:

{noformat}[18:03:06,159][ERROR][main][BinaryContext] Failed to deserialize 
object [typeName=binary.BinaryEnumExample$TestClass]
org.apache.ignite.binary.BinaryObjectException: Failed to read field 
[name=theEnum]
at 
org.apache.ignite.internal.binary.BinaryFieldAccessor.read(BinaryFieldAccessor.java:191)
 ~[classes/:?]
at 
org.apache.ignite.internal.binary.BinaryClassDescriptor.read(BinaryClassDescriptor.java:887)
 [classes/:?]
at 
org.apache.ignite.internal.binary.BinaryReaderExImpl.deserialize0(BinaryReaderExImpl.java:1762)
 [classes/:?]
at 
org.apache.ignite.internal.binary.BinaryReaderExImpl.deserialize(BinaryReaderExImpl.java:1714)
 [classes/:?]
at 
org.apache.ignite.internal.binary.BinaryObjectImpl.deserializeValue(BinaryObjectImpl.java:794)
 [classes/:?]
at 
org.apache.ignite.internal.binary.BinaryObjectImpl.deserialize(BinaryObjectImpl.java:636)
 [classes/:?]
at binary.BinaryEnumExample.main(BinaryEnumExample.java:20) [classes/:?]
Caused by: org.apache.ignite.binary.BinaryObjectException: Unexpected field 
type [pos=24, expected=Enum, actual=Enum]
at 
org.apache.ignite.internal.binary.BinaryReaderExImpl.checkFlagNoHandles(BinaryReaderExImpl.java:1677)
 ~[classes/:?]
at 
org.apache.ignite.internal.binary.BinaryReaderExImpl.readEnum0(BinaryReaderExImpl.java:1403)
 ~[classes/:?]
at 
org.apache.ignite.internal.binary.BinaryReaderExImpl.readEnum(BinaryReaderExImpl.java:1387)
 ~[classes/:?]
at 
org.apache.ignite.internal.binary.BinaryFieldAccessor$DefaultFinalClassAccessor.readFixedType(BinaryFieldAccessor.java:885)
 ~[classes/:?]
at 
org.apache.ignite.internal.binary.BinaryFieldAccessor$DefaultFinalClassAccessor.read0(BinaryFieldAccessor.java:702)
 ~[classes/:?]
at 
org.apache.ignite.internal.binary.BinaryFieldAccessor.read(BinaryFieldAccessor.java:187)
 ~[classes/:?]
... 6 more
Exception in thread "main" class 
org.apache.ignite.binary.BinaryObjectException: Failed to deserialize object 
[typeName=binary.BinaryEnumExample$TestClass]
at 
org.apache.ignite.internal.binary.BinaryClassDescriptor.read(BinaryClassDescriptor.java:926)
at 
org.apache.ignite.internal.binary.BinaryReaderExImpl.deserialize0(BinaryReaderExImpl.java:1762)
at 
org.apache.ignite.internal.binary.BinaryReaderExImpl.deserialize(BinaryReaderExImpl.java:1714)
at 
org.apache.ignite.internal.binary.BinaryObjectImpl.deserializeValue(BinaryObjectImpl.java:794)
at 
org.apache.ignite.internal.binary.BinaryObjectImpl.deserialize(BinaryObjectImpl.java:636)
at binary.BinaryEnumExample.main(BinaryEnumExample.java:20)
Caused by: class org.apache.ignite.binary.BinaryObjectException: Failed to read 
field [name=theEnum]
at 
org.apache.ignite.internal.binary.BinaryFieldAccessor.read(BinaryFieldAccessor.java:191)
at 
org.apache.ignite.internal.binary.BinaryClassDescriptor.read(BinaryClassDescriptor.java:887)
... 5 more
Caused by: class org.apache.ignite.binary.BinaryObjectException: Unexpected 
field type [pos=24, expected=Enum, actual=Enum]
at 
org.apache.ignite.internal.binary.BinaryReaderExImpl.checkFlagNoHandles(BinaryReaderExImpl.java:1677)
at 
org.apache.ignite.internal.binary.BinaryReaderExImpl.readEnum0(BinaryReaderExImpl.java:1403)
at 
org.apache.ignite.internal.binary.BinaryReaderExImpl.readEnum(BinaryReaderExImpl.java:1387)
at 
org.apache.ignite.internal.binary.BinaryFieldAccessor$DefaultFinalClassAccessor.readFixedType(BinaryFieldAccessor.java:885)
at 
org.apache.ignite.internal.binary.BinaryFieldAccessor$DefaultFinalClassAccessor.read0(BinaryFieldAccessor.java:702)
at 
org.apache.ignite.internal.binary.BinaryFieldAccessor.read(BinaryFieldAccessor.java:187)
... 6 more{noformat}




--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Created] (IGNITE-12567) H2Tree goes into illegal state when non-indexed columns are dropped

2020-01-22 Thread Konstantin Orlov (Jira)
Konstantin Orlov created IGNITE-12567:
-

 Summary: H2Tree goes into illegal state when non-indexed columns 
are dropped
 Key: IGNITE-12567
 URL: https://issues.apache.org/jira/browse/IGNITE-12567
 Project: Ignite
  Issue Type: Bug
  Components: sql
Reporter: Konstantin Orlov
Assignee: Konstantin Orlov


*How to reproduce:*
* {{CREATE TABLE tbl (f0 INT, f1 INT, f2 INT, f3 INT, f4 INT, PRIMARY KEY (f3, 
f4))}}
* populate table with some data
* {{ALTER TABLE tbl DROP COLUMN f1, f2}}
* try to execute query which will use pk index: {{SELECT * FROM tbl WHERE f3 = 
1 AND f4 = 1}} 

*Expected*:
* Query returns result set

*Actual*:
* Query fails with {{General error: "java.lang.ArrayIndexOutOfBoundsException: 
5";}}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Created] (IGNITE-12369) JdbcThinClient and Server compatibility broken

2019-11-14 Thread Konstantin Orlov (Jira)
Konstantin Orlov created IGNITE-12369:
-

 Summary: JdbcThinClient and Server compatibility broken
 Key: IGNITE-12369
 URL: https://issues.apache.org/jira/browse/IGNITE-12369
 Project: Ignite
  Issue Type: Bug
  Components: sql
Affects Versions: mas
Reporter: Konstantin Orlov
 Fix For: mas


Query cancellation support was introduced in IGNITE-5439. From this time server 
expects that ALL request have id. It breaks compatibility with clients whose 
version prior to 2.8.0.
Furthermore backport of this feature to 8.7 breaks compatibility newer build of 
server with older build of client.

See {{ClientListenerProcessor#makeFilters}}. New filter with overrided 
_onMessageReceived_ is created here. It tries to read request id and if there 
is not enough data to read long value, it crashes.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)