Uploaded image for project: 'Teiid'
  1. Teiid
  2. TEIID-5038

Couchbase importer.sampleKeyspaces not resctricting document types imported

    XMLWordPrintable

Details

    • Bug
    • Resolution: Duplicate
    • Critical
    • None
    • 8.12.11.6_4
    • Misc. Connectors
    • None

    Description

      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:

      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>
      

      is imported the same as this one:

      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>
      

      With resulting DDL containing OTHER types than those defined in dvqe_small keyspace:

      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')
      

      Attachments

        Activity

          People

            rhn-engineering-shawkins Steven Hawkins
            jstastny@redhat.com Jan Stastny
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: