dynamobi/dynamobi — Issue #210: [LDB-111] cannot run "select count ... from ... where ..." to query a table populated by inserting data from a foreign table
Author: dynamobi-build
Created: 2011-12-30 02:22:09+00:00
State: open
Labels: LDB

[reporter="kvu", created="Fri, 30 Jun 2006 14:54:37 -0500 (GMT-05:00)"]
The query:

select count("kseq") from bench10k where "kseq" between 1 and 100;

where: bench10k is a local table having 10,000 rows with kseq as primary key with values from 1 to 10,000

will get problem with stack overflow: -> Error: java.lang.StackOverflowError: null (state=,code=0)

Notes: If you run "analyze table bench10k compute statistics for all columns" before the above query, everything is fine.

To reproduce:

In directory open/luciddb/test/sql/bench run ant gen-all-sql

In directory open/luciddb/test/sql/bench run ant copy-csv

At sqllineEngine run following sql statements: (will need some change in directory name)

create foreign data wrapper ff_jdbc

library 'class com.lucidera.farrago.namespace.flatfile.FlatFileDataWrapper'

language java;

create server ff_server

foreign data wrapper ff_jdbc

options(

directory '/home/YOUR NAME HERE/open/luciddb/test/sql/bench/csv-copy',

file_extension '.csv',

ctrl_file_extension '.bcp',

field_delimiter ',',

line_delimiter '\n',

quote_char '"',

escape_char '',

with_header 'yes',

num_rows_scan '1'

);

create schema ff_schema;

create foreign table ff_schema."bench10K" (

"kseq" bigint,

"k2" bigint,

"k4" bigint,

"k5" bigint,

"k10" bigint,

"k25" bigint,

"k100" bigint,

"k1k" bigint,

"k10k" bigint,

"k40k" bigint,

"k100k" bigint,

"k250k" bigint,

"k500k" bigint

)

server ff_server

options (

SCHEMA_NAME 'BCP',

filename 'bench10K'

);

create table BENCH10K (

"kseq" bigint primary key,

"k2" bigint,

"k4" bigint,

"k5" bigint,

"k10" bigint,

"k25" bigint,

"k100" bigint,

"k1k" bigint,

"k10k" bigint,

"k40k" bigint,

"k100k" bigint,

"k250k" bigint,

"k500k" bigint)

server sys_column_store_data_server;

INSERT INTO s.BENCH10K

SELECT "kseq","k2","k4","k5","k10","k25","k100","k1k","k10k","k40k","k100k","k250k","k500k"

FROM ff_schema."bench10K";

--------------------------------------------------------------------------------------------

you can now run the select count ,,, query to reproduce the bug

Error trace:

Error: java.lang.StackOverflowError: null (state=,code=0)

net.sf.farrago.jdbc.FarragoJdbcUtil$FarragoSqlException: java.lang.StackOverflowError: null

at org.hsqldb.Result.add([Ljava.lang.Object;)V(Unknown Source)

at org.hsqldb.GroupedResult.addRow([Ljava.lang.Object;)V(Unknown Source)

at org.hsqldb.Select.buildResult(Lorg.hsqldb.Session;I)Lorg.hsqldb.Result;(Unknown Source)

at org.hsqldb.Select.getSingleResult(Lorg.hsqldb.Session;I)Lorg.hsqldb.Result;(Unknown Source)

at org.hsqldb.Select.getResult(Lorg.hsqldb.Session;I)Lorg.hsqldb.Result;(Unknown Source)

at org.hsqldb.CompiledStatementExecutor.executeSelectStatement(Lorg.hsqldb.CompiledStatement;)Lorg.hsqldb.Result;(Unknown Source)

at org.hsqldb.CompiledStatementExecutor.executeImpl(Lorg.hsqldb.CompiledStatement;)Lorg.hsqldb.Result;(Unknown Source)

at org.hsqldb.CompiledStatementExecutor.execute(Lorg.hsqldb.CompiledStatement;)Lorg.hsqldb.Result;(Unknown Source)

at org.hsqldb.Session.sqlExecute(Lorg.hsqldb.Result;)Lorg.hsqldb.Result;(Unknown Source)

at org.hsqldb.Session.execute(Lorg.hsqldb.Result;)Lorg.hsqldb.Result;(Unknown Source)

at org.hsqldb.jdbc.jdbcPreparedStatement.executeQuery()Ljava.sql.ResultSet;(Unknown Source)

at org.netbeans.mdr.persistence.jdbcimpl.JdbcStorage.getResultSetIterator(JdbcStorage.java:936)

at org.netbeans.mdr.persistence.jdbcimpl.JdbcMultivaluedIndex$ItemCollection.iterator(JdbcMultivaluedIndex.java:155)at org.netbeans.mdr.storagemodel.IndexImmutSet.iterator(IndexImmutSet.java:85)

at org.netbeans.mdr.storagemodel.CompositeCollection.iterator(CompositeCollection.java:95)

at org.netbeans.mdr.handlers.IndexSetWrapper.iterator(IndexSetWrapper.java:93)

at net.sf.farrago.catalog.FarragoCatalogUtil.getModelElementByName(FarragoCatalogUtil.java:413)

at net.sf.farrago.catalog.FarragoReposImpl.getCatalog(FarragoReposImpl.java:303)

at net.sf.farrago.query.FarragoRelMetadataProvider.getStatistics(FarragoRelMetadataProvider.java:99)

at net.sf.farrago.query.FarragoRelMetadataProvider.getRowCount(FarragoRelMetadataProvider.java:130)

at jrockit.reflect.VirtualNativeMethodInvoker.invoke(Ljava.lang.Object;[Ljava.lang.Object;)Ljava.lang.Object;(Unknown Source)

at java.lang.reflect.Method.invoke(Ljava.lang.Object;[Ljava.lang.Object;I)Ljava.lang.Object;(Unknown Source)

at org.eigenbase.rel.metadata.ReflectiveRelMetadataProvider.getRelMetadata(ReflectiveRelMetadataProvider.java:99)

at org.eigenbase.rel.metadata.ChainedRelMetadataProvider.getRelMetadata(ChainedRelMetadataProvider.java:71)

at org.eigenbase.rel.metadata.CachingRelMetadataProvider.getRelMetadata(CachingRelMetadataProvider.java:88)

at org.eigenbase.rel.metadata.ChainedRelMetadataProvider.getRelMetadata(ChainedRelMetadataProvider.java:71)

at org.eigenbase.rel.metadata.RelMetadataQuery.getRowCount(RelMetadataQuery.java:116)