[JBoss JIRA] (TEIID-4928) Couchbase - NAMEINSOURCE required for all the columns and tables
by Juraj Duráni (JIRA)
[ https://issues.jboss.org/browse/TEIID-4928?page=com.atlassian.jira.plugin... ]
Juraj Duráni commented on TEIID-4928:
-------------------------------------
> Can you provide more details, like the exception, from a failing case?
There Is not exception. I received no result (not single row). With NAMEINSOURCE, I got correct result.
> Perhaps it would be possible to provide N1QL queries to pull a representative docs in addition to or instead of limit based sampling.
That would make more sense to me, but still there is a lot of catches for which defining metadata manually would be better (sparse data, not all possible attributes present in current documents, renaming, moving buckets...). So custom N1QL query is a good option, but I would not discourage user from defining metadata manually.
> ... for a column in teiid table to map to this kinds of attr in document, the NAMEINSOURCE is necessary.
I believe you have disproved this by yourself:
{quote}
teiid load metadata will create metadata aotomaticly, because each of columns represent a attr in a json document
{quote}
If Teiid is able to do mapping *JSON attribute --> Teiid column* during metadata loading without anything else, why it is not able to map it the other way round? I.e. *Teiid column --> JSON attribute*. In fact, during metadata load e.g. JSON attribute *myAttribute* is mapped to Teiid column *myAttribute*. Why Teiid cannot do the same while mapping Teiid column *myColumn* to attribute *myColumn*? I think, that Teiid should assume, that column name and attribute name is mapped 1-to-1 in both ways by default. Only if it is not true, then user needs to define NAMEINSOURCE.
> The table name map to keyspace name in couchbase...
This does not make sense to me. Why is table name mapped to keyspace and then there is *teiid_couchbase:NAMEDTYPEPAIR* which defines *attribute:table_name* pair? Moreover, keyspace is defined twice - first in resource-adapter definition, second in metadata. For me it would make more sense this:
# Define namespace and keyspace in resource-adapter definition
# For each table, define name of the attribute which determines table - e.g.:
{code:sql}
CREATE FOREIGN TABLE MyTable(....) OPTIONS ("teiid_couchbase:NAMEDTYPE" 'type')
{code}
# Now, N1QL could look like:
{code:sql}
SELECT ... FROM `<keyspace-from-resource-adapter>` `$cb_t1` LET ... WHERE `$cb_t1`.`<attribute-name-from-options>` = '<name-of-the-table>'
{code}
E.g.
{code:sql}
SELECT ... FROM `my_bucket` `$cb_t1` LET ... WHERE `$cb_t1`.`type` = 'MyTable'
{code}
> Another reason for a table need a NAMEINSOURCE is array table...
For array tables, I understand information like NAMEINSOURCE is needed and it could be tricky. But I wonder, whether we need to mess up NAMEINSOURCE and fact that table is array table.
Here is my suggestion (consider it really only suggestion as I did not try modeling them):
# Currently, there are two information that table is an array table - it is indicated by NAMEINSOURCE and teiid_couchbase:ISARRAYTABLE option.
# How about using only option
## change *teiid_couchbase:ISARRAYTABLE* to *teiid_couchbase:ARRAYTABLE*
## change type from boolean to string (with values like *nested\[\]\[\]*)
## if the option *IS NOT* present, consider table to be a regular table
## if the option *IS* present, consider table to be an array table and use value just like you use NAMEINSOURCE now
What do you think? Does it make sense?
> 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)
8 years, 10 months
[JBoss JIRA] (TEIID-4867) Loosen up OData4 URL validation or parsing
by RH Bugzilla Integration (JIRA)
[ https://issues.jboss.org/browse/TEIID-4867?page=com.atlassian.jira.plugin... ]
RH Bugzilla Integration updated TEIID-4867:
-------------------------------------------
Bugzilla References: https://bugzilla.redhat.com/show_bug.cgi?id=1451785, https://bugzilla.redhat.com/show_bug.cgi?id=1446180, https://bugzilla.redhat.com/show_bug.cgi?id=1446201
Bugzilla Update: Perform
> Loosen up OData4 URL validation or parsing
> ------------------------------------------
>
> Key: TEIID-4867
> URL: https://issues.jboss.org/browse/TEIID-4867
> Project: Teiid
> Issue Type: Bug
> Components: OData
> Affects Versions: 8.12.8.6_3
> Environment: JDV 6.3.2
> Windows 7
> Reporter: Steve Tran
> Assignee: Johnathon Lee
> Fix For: 8.12.x-6.4, 8.12.11.6_3
>
>
> I'm accessing my JDV table via OData4 through Salesforce's UI builder. The salesforce engine itself is creating the OData calls, and whenever a $filter is needed with multiple columns, it looks like salesforce pads the column name with a space in front and behind. That'll make the URL look like ...$filter={color:red}%20{color}ColumnA{color:red}%20{color}eq%20123%20and{color:red}%20{color}ColumnB{color:red}%20{color}eq...
> The first space right after the $filter= throws off the JDV engine as it thinks it's a malformed URL - which I guess it is. The thing is when I tested it via the OData2 interface, it accepted it just fine. I'm not sure if the OData4 specifications explicitly state in terms of the URL, so it could be anybody's bug. Perhaps we could make JDV a little more forgiving and trim the spaces after un-URL-encoding the URI.
--
This message was sent by Atlassian JIRA
(v7.2.3#72005)
8 years, 10 months
[JBoss JIRA] (TEIID-4928) Couchbase - NAMEINSOURCE required for all the columns and tables
by Kylin Soong (JIRA)
[ https://issues.jboss.org/browse/TEIID-4928?page=com.atlassian.jira.plugin... ]
Kylin Soong commented on TEIID-4928:
------------------------------------
> A you saying that we'll need more documentation on how to define the metadata manually? Or are you suggesting that we should reuse the simba schema tools?
simba schema tools seems has difficult, probably we add a tools like the teiid-oauth-util.sh, run this tool can generate a ddl,sql or souce-model,xml. How to define the metadata manually also is lacked.
> 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)
8 years, 10 months
[JBoss JIRA] (TEIID-4928) Couchbase - NAMEINSOURCE required for all the columns and tables
by Kylin Soong (JIRA)
[ https://issues.jboss.org/browse/TEIID-4928?page=com.atlassian.jira.plugin... ]
Kylin Soong commented on TEIID-4928:
------------------------------------
Hi [~jdurani]
Thanks for your contribute on Couchbase connector. I would like to add additional comments to account for some of your questions, I hope this can help you.
> Why need NAMEINSOURCE for each of columns and tables?
First, you need to know the Logical Hierarchy based data stracture of a Couchbase cluster, it looks
{code}
Namespaces
└── Keyspaces
└──Documents
{code}
the documents under keyspaces are schemaless, which can contain different structure of documents, these documents also main contain multiple dimension of nested json, or nested arrays or arrays of differently-typed elements.
The path expressions get retrive the value of a attr, eg, the below path is to retrive of the value of p_asia, which under the nested document geo,
{code}
namespace:keyspace/`travel-sample`.geo.`p_asia`
{code}
the below path is to retrive of the value of multiple dimension of nested array
{code}
namespace:keyspace/`travel-sample`.a[0][0][1][1]
{code}
The Couchbase don't like other document database, it not supply any metadata, teiid load metadata will create metadata aotomaticly, because each of columns represent a attr in a json document, for a column in teiid table to map to this kinds of attr in document, the NAMEINSOURCE is necessary.
The table name map to keyspace name in couchbase, same reason, due to lack of couchbase based native metadata, a TypeNameList properties are used to define table name, eg, if you define
{code}
<property name="importer.typeNameList" value="`default`:`type`"/>
{code}
then teiid load all documents under Keyspace default, if a document has a attribute `type`, then the referenced value will be treated as table name. So for each table a NAMEINSOURCE also is necessary, we need use it to real Keyspace.
Another reason for a table need a NAMEINSOURCE is array table, any array existed in a document will be map to a separate table, as above path expressions example, it's a 4 dimension array, the generated tables looks as [1], for this occasion, the NAMEINSOURCE is also a path expression and necessary.
> How to avoid pass null
Base on the design so far, not try to design souce model by yourself, use CouchbaseMetadataProcessor generated tables/procedures. If you want to design souce model by yourself, you should strictly base on the logic of Generating Schema sesion in [2].
Feel free to update the document, if you have good understand of design souche model, you can add a "Design Schema" section in [2].
> Does sampleSize make sense?
Due to CouchbaseMetadataProcessor fetch all documents in different Keyspaces, so a sampleSize is use to control maximum number of documents should be fetch per keyspace.
Actually, some other Couchbase JDBC provider(like Simba, Talend) also use the same logic, use a sampleSize to avoid select all, there is not good ways to resolve schemaless, zero-metadata documents database.
Kylin
[1] https://github.com/teiid/teiid/blob/master/connectors/couchbase/translato...
[2] https://teiid.gitbooks.io/documents/content/reference/couchbase_translato...
> 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)
8 years, 10 months
[JBoss JIRA] (TEIID-4932) Support defining UDFs based upon a class and or function
by Steven Hawkins (JIRA)
Steven Hawkins created TEIID-4932:
-------------------------------------
Summary: Support defining UDFs based upon a class and or function
Key: TEIID-4932
URL: https://issues.jboss.org/browse/TEIID-4932
Project: Teiid
Issue Type: Enhancement
Components: Query Engine
Reporter: Steven Hawkins
Assignee: Steven Hawkins
Fix For: 10.x
With the new ddl support, we should allow an import to work against a class to define UDFs.
We should also in general support inferring arguments for UDFs and UDFs that are defined by a method.
--
This message was sent by Atlassian JIRA
(v7.2.3#72005)
8 years, 10 months
[JBoss JIRA] (TEIID-4931) No Deployed Virtual Databases on console
by Steven Hawkins (JIRA)
[ https://issues.jboss.org/browse/TEIID-4931?page=com.atlassian.jira.plugin... ]
Steven Hawkins commented on TEIID-4931:
---------------------------------------
If you directly query the cli or use adminshell to get the vdbs, what do you see?
That will help determine if this is specifically a console issue.
> No Deployed Virtual Databases on console
> ----------------------------------------
>
> Key: TEIID-4931
> URL: https://issues.jboss.org/browse/TEIID-4931
> Project: Teiid
> Issue Type: Bug
> Affects Versions: 9.2.3
> Environment: * Wildfly 10
> * Teiid Server 9.2.3
> Reporter: Pedro Inácio
> Assignee: Steven Hawkins
> Attachments: image-2017-05-24-17-24-08-386.png, server.log
>
>
> After several deploys/undeploys of several VDBs, no VDB is listed any longer on console (Deployed Virtual Databases), although VDBs are effectively deployed.
> On logs:
> 2017-05-24 16:17:49,223 INFO [org.teiid.RUNTIME.VDBLifeCycleListener] (Worker2_async-teiid-threads2) TEIID40003 VDB NetSuiteMappingVDB.1 is set to ACTIVE
> 2017-05-24 16:17:49,271 INFO [org.teiid.RUNTIME.VDBLifeCycleListener] (Worker0_async-teiid-threads0) TEIID40003 VDB CerillionVDB.1 is set to ACTIVE
> 2017-05-24 16:17:50,187 INFO [org.teiid.RUNTIME.VDBLifeCycleListener] (Worker3_async-teiid-threads3) TEIID40003 VDB SalesForceVDB.1 is set to ACTIVE
> 2017-05-24 16:17:50,609 INFO [org.teiid.RUNTIME.VDBLifeCycleListener] (Worker4_async-teiid-threads4) TEIID40003 VDB BillingVDB.1 is set to ACTIVE
> 2017-05-24 16:17:52,012 INFO [org.teiid.RUNTIME.VDBLifeCycleListener] (Worker3_async-teiid-threads5) TEIID40003 VDB CustomerVDB.1 is set to ACTIVE
> 2017-05-24 16:18:26,238 INFO [org.teiid.RUNTIME.VDBLifeCycleListener] (Worker1_async-teiid-threads1) TEIID40003 VDB NetSuiteVDB.1 is set to ACTIVE
> 2017-05-24 16:18:26,584 INFO [org.teiid.RUNTIME.VDBLifeCycleListener] (Worker1_async-teiid-threads6) TEIID40003 VDB ReferenceDataVDB.1 is set to ACTIVE
> 2017-05-24 16:18:27,115 INFO [org.teiid.RUNTIME.VDBLifeCycleListener] (Worker1_async-teiid-threads7) TEIID40003 VDB FinanceVDB.1 is set to ACTIVE
> On console.
> !image-2017-05-24-17-24-08-386.png|thumbnail!
--
This message was sent by Atlassian JIRA
(v7.2.3#72005)
8 years, 10 months