]
RH Bugzilla Integration commented on TEIID-5038:
------------------------------------------------
Debi Rieden <drieden(a)redhat.com> changed the Status of [bug
Couchbase importer.sampleKeyspaces not resctricting document types
imported
---------------------------------------------------------------------------
Key: TEIID-5038
URL:
https://issues.jboss.org/browse/TEIID-5038
Project: Teiid
Issue Type: Bug
Components: Misc. Connectors
Affects Versions: 8.12.x-6.4
Reporter: Jan Stastny
Assignee: Steven Hawkins
Priority: Critical
A vdb with importer.sampleKeyspaces property doesn't restrict the keyspaces imported.
From the docs:
??A comma-separate list of the keyspace names, used to fine-grained control which
keyspaces should be mapped, by default map all keyspaces.??
I have two keyspaces:
* dvqe_small
* dvqe_other
The dvqe_small one contains ONLY types:
* SmallA
* SmallB
But this vdb:
{code:xml|title=vdb with sampleKeyspaces}
<?xml version="1.0" encoding="UTF-8"
standalone="yes"?>
<vdb name="couchbase_crud" version="1">
<model name="Source" type="PHYSICAL"
visible="true">
<property name="importer.typeNameList"
value="`dvqe_small`:`type`,`dvqe_other`:`type`"/>
<property name="importer.sampleKeyspaces"
value="`dvqe_small`"/>
<source name="Source"
connection-jndi-name="java:/couchbase_crud"
translator-name="couchbase"/>
</model>
</vdb>
{code}
is imported the same as this one:
{code:xml|title=vdb without sampleKeyspaces}
<?xml version="1.0" encoding="UTF-8"
standalone="yes"?>
<vdb name="couchbase_crud" version="1">
<model name="Source" type="PHYSICAL"
visible="true">
<property name="importer.typeNameList"
value="`dvqe_small`:`type`,`dvqe_other`:`type`"/>
<source name="Source"
connection-jndi-name="java:/couchbase_crud"
translator-name="couchbase"/>
</model>
</vdb>
{code}
With resulting DDL containing OTHER types than those defined in dvqe_small keyspace:
{code:sql|title=import result}
SET NAMESPACE 'http://www.teiid.org/translator/couchbase/2017' AS
teiid_couchbase;
CREATE FOREIGN TABLE dvqe_crud (
documentID string,
CONSTRAINT PK0 PRIMARY KEY(documentID)
) OPTIONS (NAMEINSOURCE '`dvqe_crud`', UPDATABLE TRUE,
"teiid_couchbase:ISARRAYTABLE" 'false');
CREATE FOREIGN TABLE LargeA (
documentID string,
BigDecimalValue integer OPTIONS (NAMEINSOURCE
'`dvqe_other`.`BigDecimalValue`'),
BigIntegerValue integer OPTIONS (NAMEINSOURCE
'`dvqe_other`.`BigIntegerValue`'),
BooleanValue boolean OPTIONS (NAMEINSOURCE '`dvqe_other`.`BooleanValue`'),
ByteNum integer OPTIONS (NAMEINSOURCE '`dvqe_other`.`ByteNum`'),
CharValue string OPTIONS (NAMEINSOURCE '`dvqe_other`.`CharValue`'),
DateValue string OPTIONS (NAMEINSOURCE '`dvqe_other`.`DateValue`'),
DoubleNum integer OPTIONS (NAMEINSOURCE '`dvqe_other`.`DoubleNum`'),
FloatNum integer OPTIONS (NAMEINSOURCE '`dvqe_other`.`FloatNum`'),
IntKey integer OPTIONS (NAMEINSOURCE '`dvqe_other`.`IntKey`'),
LongNum integer OPTIONS (NAMEINSOURCE '`dvqe_other`.`LongNum`'),
ObjectValue string OPTIONS (NAMEINSOURCE '`dvqe_other`.`ObjectValue`'),
ShortValue integer OPTIONS (NAMEINSOURCE '`dvqe_other`.`ShortValue`'),
StringKey string OPTIONS (NAMEINSOURCE '`dvqe_other`.`StringKey`'),
StringNum string OPTIONS (NAMEINSOURCE '`dvqe_other`.`StringNum`'),
TimeValue string OPTIONS (NAMEINSOURCE '`dvqe_other`.`TimeValue`'),
TimestampValue string OPTIONS (NAMEINSOURCE '`dvqe_other`.`TimestampValue`'),
type string OPTIONS (NAMEINSOURCE '`dvqe_other`.`type`'),
IntNum integer OPTIONS (NAMEINSOURCE '`dvqe_other`.`IntNum`'),
CONSTRAINT PK0 PRIMARY KEY(documentID)
) OPTIONS (NAMEINSOURCE '`dvqe_other`', UPDATABLE TRUE,
"teiid_couchbase:ISARRAYTABLE" 'false',
"teiid_couchbase:NAMEDTYPEPAIR" '`type`:''LargeA''');
CREATE FOREIGN TABLE LargeB (
documentID string,
BigDecimalValue integer OPTIONS (NAMEINSOURCE
'`dvqe_other`.`BigDecimalValue`'),
BigIntegerValue integer OPTIONS (NAMEINSOURCE
'`dvqe_other`.`BigIntegerValue`'),
BooleanValue boolean OPTIONS (NAMEINSOURCE '`dvqe_other`.`BooleanValue`'),
ByteNum integer OPTIONS (NAMEINSOURCE '`dvqe_other`.`ByteNum`'),
CharValue string OPTIONS (NAMEINSOURCE '`dvqe_other`.`CharValue`'),
DateValue string OPTIONS (NAMEINSOURCE '`dvqe_other`.`DateValue`'),
DoubleNum integer OPTIONS (NAMEINSOURCE '`dvqe_other`.`DoubleNum`'),
FloatNum integer OPTIONS (NAMEINSOURCE '`dvqe_other`.`FloatNum`'),
IntKey integer OPTIONS (NAMEINSOURCE '`dvqe_other`.`IntKey`'),
LongNum integer OPTIONS (NAMEINSOURCE '`dvqe_other`.`LongNum`'),
ObjectValue string OPTIONS (NAMEINSOURCE '`dvqe_other`.`ObjectValue`'),
ShortValue integer OPTIONS (NAMEINSOURCE '`dvqe_other`.`ShortValue`'),
StringKey string OPTIONS (NAMEINSOURCE '`dvqe_other`.`StringKey`'),
StringNum string OPTIONS (NAMEINSOURCE '`dvqe_other`.`StringNum`'),
TimeValue string OPTIONS (NAMEINSOURCE '`dvqe_other`.`TimeValue`'),
TimestampValue string OPTIONS (NAMEINSOURCE '`dvqe_other`.`TimestampValue`'),
type string OPTIONS (NAMEINSOURCE '`dvqe_other`.`type`'),
IntNum integer OPTIONS (NAMEINSOURCE '`dvqe_other`.`IntNum`'),
CONSTRAINT PK0 PRIMARY KEY(documentID)
) OPTIONS (NAMEINSOURCE '`dvqe_other`', UPDATABLE TRUE,
"teiid_couchbase:ISARRAYTABLE" 'false',
"teiid_couchbase:NAMEDTYPEPAIR" '`type`:''LargeB''');
CREATE FOREIGN TABLE MediumA (
documentID string,
BigDecimalValue integer OPTIONS (NAMEINSOURCE
'`dvqe_other`.`BigDecimalValue`'),
BigIntegerValue integer OPTIONS (NAMEINSOURCE
'`dvqe_other`.`BigIntegerValue`'),
BooleanValue boolean OPTIONS (NAMEINSOURCE '`dvqe_other`.`BooleanValue`'),
ByteNum integer OPTIONS (NAMEINSOURCE '`dvqe_other`.`ByteNum`'),
CharValue string OPTIONS (NAMEINSOURCE '`dvqe_other`.`CharValue`'),
DateValue string OPTIONS (NAMEINSOURCE '`dvqe_other`.`DateValue`'),
DoubleNum integer OPTIONS (NAMEINSOURCE '`dvqe_other`.`DoubleNum`'),
FloatNum integer OPTIONS (NAMEINSOURCE '`dvqe_other`.`FloatNum`'),
IntKey integer OPTIONS (NAMEINSOURCE '`dvqe_other`.`IntKey`'),
LongNum integer OPTIONS (NAMEINSOURCE '`dvqe_other`.`LongNum`'),
ObjectValue string OPTIONS (NAMEINSOURCE '`dvqe_other`.`ObjectValue`'),
ShortValue integer OPTIONS (NAMEINSOURCE '`dvqe_other`.`ShortValue`'),
StringKey string OPTIONS (NAMEINSOURCE '`dvqe_other`.`StringKey`'),
StringNum string OPTIONS (NAMEINSOURCE '`dvqe_other`.`StringNum`'),
TimeValue string OPTIONS (NAMEINSOURCE '`dvqe_other`.`TimeValue`'),
TimestampValue string OPTIONS (NAMEINSOURCE '`dvqe_other`.`TimestampValue`'),
type string OPTIONS (NAMEINSOURCE '`dvqe_other`.`type`'),
IntNum integer OPTIONS (NAMEINSOURCE '`dvqe_other`.`IntNum`'),
CONSTRAINT PK0 PRIMARY KEY(documentID)
) OPTIONS (NAMEINSOURCE '`dvqe_other`', UPDATABLE TRUE,
"teiid_couchbase:ISARRAYTABLE" 'false',
"teiid_couchbase:NAMEDTYPEPAIR" '`type`:''MediumA''');
CREATE FOREIGN TABLE MediumB (
documentID string,
BigDecimalValue integer OPTIONS (NAMEINSOURCE
'`dvqe_other`.`BigDecimalValue`'),
BigIntegerValue integer OPTIONS (NAMEINSOURCE
'`dvqe_other`.`BigIntegerValue`'),
BooleanValue boolean OPTIONS (NAMEINSOURCE '`dvqe_other`.`BooleanValue`'),
ByteNum integer OPTIONS (NAMEINSOURCE '`dvqe_other`.`ByteNum`'),
CharValue string OPTIONS (NAMEINSOURCE '`dvqe_other`.`CharValue`'),
DateValue string OPTIONS (NAMEINSOURCE '`dvqe_other`.`DateValue`'),
DoubleNum integer OPTIONS (NAMEINSOURCE '`dvqe_other`.`DoubleNum`'),
FloatNum integer OPTIONS (NAMEINSOURCE '`dvqe_other`.`FloatNum`'),
IntKey integer OPTIONS (NAMEINSOURCE '`dvqe_other`.`IntKey`'),
LongNum integer OPTIONS (NAMEINSOURCE '`dvqe_other`.`LongNum`'),
ObjectValue string OPTIONS (NAMEINSOURCE '`dvqe_other`.`ObjectValue`'),
ShortValue integer OPTIONS (NAMEINSOURCE '`dvqe_other`.`ShortValue`'),
StringKey string OPTIONS (NAMEINSOURCE '`dvqe_other`.`StringKey`'),
StringNum string OPTIONS (NAMEINSOURCE '`dvqe_other`.`StringNum`'),
TimeValue string OPTIONS (NAMEINSOURCE '`dvqe_other`.`TimeValue`'),
TimestampValue string OPTIONS (NAMEINSOURCE '`dvqe_other`.`TimestampValue`'),
type string OPTIONS (NAMEINSOURCE '`dvqe_other`.`type`'),
IntNum integer OPTIONS (NAMEINSOURCE '`dvqe_other`.`IntNum`'),
CONSTRAINT PK0 PRIMARY KEY(documentID)
) OPTIONS (NAMEINSOURCE '`dvqe_other`', UPDATABLE TRUE,
"teiid_couchbase:ISARRAYTABLE" 'false',
"teiid_couchbase:NAMEDTYPEPAIR" '`type`:''MediumB''');
CREATE FOREIGN TABLE SmallA (
documentID string,
BigDecimalValue integer OPTIONS (NAMEINSOURCE
'`dvqe_small`.`BigDecimalValue`'),
BigIntegerValue integer OPTIONS (NAMEINSOURCE
'`dvqe_small`.`BigIntegerValue`'),
BooleanValue boolean OPTIONS (NAMEINSOURCE '`dvqe_small`.`BooleanValue`'),
ByteNum integer OPTIONS (NAMEINSOURCE '`dvqe_small`.`ByteNum`'),
CharValue string OPTIONS (NAMEINSOURCE '`dvqe_small`.`CharValue`'),
DateValue string OPTIONS (NAMEINSOURCE '`dvqe_small`.`DateValue`'),
DoubleNum integer OPTIONS (NAMEINSOURCE '`dvqe_small`.`DoubleNum`'),
FloatNum integer OPTIONS (NAMEINSOURCE '`dvqe_small`.`FloatNum`'),
IntKey integer OPTIONS (NAMEINSOURCE '`dvqe_small`.`IntKey`'),
LongNum integer OPTIONS (NAMEINSOURCE '`dvqe_small`.`LongNum`'),
ObjectValue string OPTIONS (NAMEINSOURCE '`dvqe_small`.`ObjectValue`'),
ShortValue integer OPTIONS (NAMEINSOURCE '`dvqe_small`.`ShortValue`'),
StringKey string OPTIONS (NAMEINSOURCE '`dvqe_small`.`StringKey`'),
StringNum string OPTIONS (NAMEINSOURCE '`dvqe_small`.`StringNum`'),
TimeValue string OPTIONS (NAMEINSOURCE '`dvqe_small`.`TimeValue`'),
TimestampValue string OPTIONS (NAMEINSOURCE '`dvqe_small`.`TimestampValue`'),
type string OPTIONS (NAMEINSOURCE '`dvqe_small`.`type`'),
IntNum integer OPTIONS (NAMEINSOURCE '`dvqe_small`.`IntNum`'),
CONSTRAINT PK0 PRIMARY KEY(documentID)
) OPTIONS (NAMEINSOURCE '`dvqe_small`', UPDATABLE TRUE,
"teiid_couchbase:ISARRAYTABLE" 'false',
"teiid_couchbase:NAMEDTYPEPAIR" '`type`:''SmallA''');
CREATE FOREIGN TABLE SmallB (
documentID string,
BigDecimalValue integer OPTIONS (NAMEINSOURCE
'`dvqe_small`.`BigDecimalValue`'),
BigIntegerValue integer OPTIONS (NAMEINSOURCE
'`dvqe_small`.`BigIntegerValue`'),
BooleanValue boolean OPTIONS (NAMEINSOURCE '`dvqe_small`.`BooleanValue`'),
ByteNum integer OPTIONS (NAMEINSOURCE '`dvqe_small`.`ByteNum`'),
CharValue string OPTIONS (NAMEINSOURCE '`dvqe_small`.`CharValue`'),
DateValue string OPTIONS (NAMEINSOURCE '`dvqe_small`.`DateValue`'),
DoubleNum integer OPTIONS (NAMEINSOURCE '`dvqe_small`.`DoubleNum`'),
FloatNum integer OPTIONS (NAMEINSOURCE '`dvqe_small`.`FloatNum`'),
IntKey integer OPTIONS (NAMEINSOURCE '`dvqe_small`.`IntKey`'),
LongNum integer OPTIONS (NAMEINSOURCE '`dvqe_small`.`LongNum`'),
ObjectValue string OPTIONS (NAMEINSOURCE '`dvqe_small`.`ObjectValue`'),
ShortValue integer OPTIONS (NAMEINSOURCE '`dvqe_small`.`ShortValue`'),
StringKey string OPTIONS (NAMEINSOURCE '`dvqe_small`.`StringKey`'),
StringNum string OPTIONS (NAMEINSOURCE '`dvqe_small`.`StringNum`'),
TimeValue string OPTIONS (NAMEINSOURCE '`dvqe_small`.`TimeValue`'),
TimestampValue string OPTIONS (NAMEINSOURCE '`dvqe_small`.`TimestampValue`'),
type string OPTIONS (NAMEINSOURCE '`dvqe_small`.`type`'),
IntNum integer OPTIONS (NAMEINSOURCE '`dvqe_small`.`IntNum`'),
CONSTRAINT PK0 PRIMARY KEY(documentID)
) OPTIONS (NAMEINSOURCE '`dvqe_small`', UPDATABLE TRUE,
"teiid_couchbase:ISARRAYTABLE" 'false',
"teiid_couchbase:NAMEDTYPEPAIR" '`type`:''SmallB''');
CREATE FOREIGN PROCEDURE getDocument(IN id string NOT NULL OPTIONS (ANNOTATION 'The
document id of what documents to return'), IN keyspace string NOT NULL OPTIONS
(ANNOTATION 'The keyspace name used to retrieve the document')) RETURNS TABLE
(result blob)
OPTIONS (ANNOTATION 'Return a json document that match the given document id as
BLOB')
CREATE FOREIGN PROCEDURE getDocuments(IN id string NOT NULL OPTIONS (ANNOTATION 'The
document id or SQL like pattern of what documents to return, for example, the
''%'' sign is used to define wildcards (missing letters) both before and
after the pattern'), IN keyspace string NOT NULL OPTIONS (ANNOTATION 'The keyspace
name used to retrieve the documents')) RETURNS TABLE (result blob)
OPTIONS (ANNOTATION 'Returns json documents that match the given document id or id
pattern as BLOBs')
{code}