[teiid-issues] [JBoss JIRA] (TEIID-4928) Couchbase - NAMEINSOURCE required for all the columns and tables

Kylin Soong (JIRA) issues at jboss.org
Wed May 24 06:55:00 EDT 2017


    [ https://issues.jboss.org/browse/TEIID-4928?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13411165#comment-13411165 ] 

Kylin Soong commented on TEIID-4928:
------------------------------------

Thanks [~jdurani] for report, 
> column name in source query is not enclosed in back quotes - e.g. `$cb_t1`.ShortValue instead of `$cb_t1`.`ShortValue`
This for compatible with N1QL reference

> name of the table is not added to the source query - e.g. SELECT ... FROM null `$cb_t1` LET ... WHERE ... instead of SELECT ... FROM `smalla` `$cb_t1` LET ... WHERE ...
Yes, this is default design pattern, not that, the couchbase server don't have any schema(the schema generated on translator load metadata), the couchabse server only contain the documents under keyspace, a sql query against a table will convert to a n1ql query against couchbase keyspace, so it's may confused if you deving into the souce query. [1] has some souce query N1QL, you can have a look at.

> In case of table I think this is more serious as it does not even try name of the table but supplies null to the query

I think it's not possible to pass a null, cause the table name in schema are strict 1-to-1 mapped with keyspace name in Couchbase server. Also It's not recommend to define the table by your self, the schema are auto-generated, you just need to use the generated ones, refer to [2] for details about schema generation, the parent folder of [1] also has lots of .expected file, it contain the auto-generated schema.

[1] https://github.com/teiid/teiid/blob/master/connectors/couchbase/translator-couchbase/src/test/resources/N1QL.properties
[2] https://teiid.gitbooks.io/documents/content/reference/couchbase_translator.html#_generating_schema





> Couchbase - NAMEINSOURCE required for all the columns and tables
> ----------------------------------------------------------------
>
>                 Key: TEIID-4928
>                 URL: https://issues.jboss.org/browse/TEIID-4928
>             Project: Teiid
>          Issue Type: Bug
>          Components: Misc. Connectors
>    Affects Versions: 9.3
>            Reporter: Juraj Duráni
>            Assignee: Kylin Soong
>
> Option *NAMEINSOURCE* is de facto required for all the columns and tables. If it is not present then:
> # column name in source query is not enclosed in back quotes - e.g. *`$cb_t1`.ShortValue* instead of *`$cb_t1`.`ShortValue`*
> # name of the table is not added to the source query - e.g. *SELECT ... FROM null `$cb_t1` LET ... WHERE ...* instead of *SELECT ... FROM `smalla` `$cb_t1` LET ... WHERE ...*
> This should work OOB without need to add NAMEINSOURCE option. Teiid should automatically translate column name from e.g. *MyColumn* to *`MyColumn`* if option is not set. Same with name of the table.
> In case of table I think this is more serious as it does not even try name of the table but supplies *null* to the query



--
This message was sent by Atlassian JIRA
(v7.2.3#72005)



More information about the teiid-issues mailing list