[JBoss JIRA] (TEIID-2988) MongoDB: Function substring - starting index and number of arguments
by Ramesh Reddy (JIRA)
[ https://issues.jboss.org/browse/TEIID-2988?page=com.atlassian.jira.plugin... ]
Ramesh Reddy commented on TEIID-2988:
-------------------------------------
You are correct, I did not see the correct text here http://docs.mongodb.org/manual/reference/operator/aggregation/substr/
Modified the code, see the new commit to reflect the changes https://github.com/teiid/teiid/commit/7476893a07d2896e24d54db1951f1f0b66c...
> MongoDB: Function substring - starting index and number of arguments
> --------------------------------------------------------------------
>
> Key: TEIID-2988
> URL: https://issues.jboss.org/browse/TEIID-2988
> Project: Teiid
> Issue Type: Bug
> Components: Misc. Connectors
> Affects Versions: 8.4.1
> Reporter: Filip Elias
> Assignee: Ramesh Reddy
> Labels: Beta1
> Fix For: 8.8, 8.7.1
>
>
> Two minor bugs in function substring()
> Mongo's function $substr takes only 3 arguments so this query fails:
> {code}
> SELECT intkey, SUBSTRING(BQT1.SmallA.stringkey, 1) FROM BQT1.SmallA ORDER BY intkey
> {code}
> {code}
> Exception:13:18:48,220 ERROR [org.teiid.CONNECTOR] (Worker38_QueryProcessorQueue345) Connector worker process failed for atomic-request=omsmHP0o16Sa.40.0.86: com.mongodb.CommandFailureException: { "serverUsed" : "localhost/127.0.0.1:27017" , "errmsg" : "exception: the $substr operator requires 3 operand(s)" , "code" : 16020 , "ok" : 0.0}
> at com.mongodb.CommandResult.getException(CommandResult.java:71)
> at com.mongodb.CommandResult.throwOnError(CommandResult.java:110)
> at com.mongodb.DBCollection.aggregate(DBCollection.java:1308)
> {code}
> Generated mongo command:
> {code}
> { aggregate: "smalla", pipeline: [ { $project: { c_0: "$INTKEY", c_1: { $substr: [ "$STRINGKEY", 1 ] } } }, { $sort: { c_0: 1 } } ] }
> {code}
> Mongo's $substr function second argument represents number of bytes to skip, not the starting index. The function substring(StringKey,1,1) returns the second letter, but it should return the first letter.
--
This message was sent by Atlassian JIRA
(v6.3.8#6338)
10 years, 1 month
[JBoss JIRA] (TEIID-2988) MongoDB: Function substring - starting index and number of arguments
by Steven Hawkins (JIRA)
[ https://issues.jboss.org/browse/TEIID-2988?page=com.atlassian.jira.plugin... ]
Steven Hawkins commented on TEIID-2988:
---------------------------------------
No, we don't have anything to restrict that. I don't see in the MongoDB doc that literals are required either. It says it just needs to be an expression that resolves to an integer.
> MongoDB: Function substring - starting index and number of arguments
> --------------------------------------------------------------------
>
> Key: TEIID-2988
> URL: https://issues.jboss.org/browse/TEIID-2988
> Project: Teiid
> Issue Type: Bug
> Components: Misc. Connectors
> Affects Versions: 8.4.1
> Reporter: Filip Elias
> Assignee: Ramesh Reddy
> Labels: Beta1
> Fix For: 8.8, 8.7.1
>
>
> Two minor bugs in function substring()
> Mongo's function $substr takes only 3 arguments so this query fails:
> {code}
> SELECT intkey, SUBSTRING(BQT1.SmallA.stringkey, 1) FROM BQT1.SmallA ORDER BY intkey
> {code}
> {code}
> Exception:13:18:48,220 ERROR [org.teiid.CONNECTOR] (Worker38_QueryProcessorQueue345) Connector worker process failed for atomic-request=omsmHP0o16Sa.40.0.86: com.mongodb.CommandFailureException: { "serverUsed" : "localhost/127.0.0.1:27017" , "errmsg" : "exception: the $substr operator requires 3 operand(s)" , "code" : 16020 , "ok" : 0.0}
> at com.mongodb.CommandResult.getException(CommandResult.java:71)
> at com.mongodb.CommandResult.throwOnError(CommandResult.java:110)
> at com.mongodb.DBCollection.aggregate(DBCollection.java:1308)
> {code}
> Generated mongo command:
> {code}
> { aggregate: "smalla", pipeline: [ { $project: { c_0: "$INTKEY", c_1: { $substr: [ "$STRINGKEY", 1 ] } } }, { $sort: { c_0: 1 } } ] }
> {code}
> Mongo's $substr function second argument represents number of bytes to skip, not the starting index. The function substring(StringKey,1,1) returns the second letter, but it should return the first letter.
--
This message was sent by Atlassian JIRA
(v6.3.8#6338)
10 years, 1 month
[JBoss JIRA] (TEIID-2988) MongoDB: Function substring - starting index and number of arguments
by Ramesh Reddy (JIRA)
[ https://issues.jboss.org/browse/TEIID-2988?page=com.atlassian.jira.plugin... ]
Ramesh Reddy updated TEIID-2988:
--------------------------------
Comment: was deleted
(was: Not in Mongo, http://docs.mongodb.org/manual/reference/operator/aggregation/substr/
If expression comes in from Teiid, then that could be issue. Is there capability not to allow expressions in Functions?)
> MongoDB: Function substring - starting index and number of arguments
> --------------------------------------------------------------------
>
> Key: TEIID-2988
> URL: https://issues.jboss.org/browse/TEIID-2988
> Project: Teiid
> Issue Type: Bug
> Components: Misc. Connectors
> Affects Versions: 8.4.1
> Reporter: Filip Elias
> Assignee: Ramesh Reddy
> Labels: Beta1
> Fix For: 8.8, 8.7.1
>
>
> Two minor bugs in function substring()
> Mongo's function $substr takes only 3 arguments so this query fails:
> {code}
> SELECT intkey, SUBSTRING(BQT1.SmallA.stringkey, 1) FROM BQT1.SmallA ORDER BY intkey
> {code}
> {code}
> Exception:13:18:48,220 ERROR [org.teiid.CONNECTOR] (Worker38_QueryProcessorQueue345) Connector worker process failed for atomic-request=omsmHP0o16Sa.40.0.86: com.mongodb.CommandFailureException: { "serverUsed" : "localhost/127.0.0.1:27017" , "errmsg" : "exception: the $substr operator requires 3 operand(s)" , "code" : 16020 , "ok" : 0.0}
> at com.mongodb.CommandResult.getException(CommandResult.java:71)
> at com.mongodb.CommandResult.throwOnError(CommandResult.java:110)
> at com.mongodb.DBCollection.aggregate(DBCollection.java:1308)
> {code}
> Generated mongo command:
> {code}
> { aggregate: "smalla", pipeline: [ { $project: { c_0: "$INTKEY", c_1: { $substr: [ "$STRINGKEY", 1 ] } } }, { $sort: { c_0: 1 } } ] }
> {code}
> Mongo's $substr function second argument represents number of bytes to skip, not the starting index. The function substring(StringKey,1,1) returns the second letter, but it should return the first letter.
--
This message was sent by Atlassian JIRA
(v6.3.8#6338)
10 years, 1 month
[JBoss JIRA] (TEIID-2988) MongoDB: Function substring - starting index and number of arguments
by Ramesh Reddy (JIRA)
[ https://issues.jboss.org/browse/TEIID-2988?page=com.atlassian.jira.plugin... ]
Ramesh Reddy commented on TEIID-2988:
-------------------------------------
Not in Mongo, http://docs.mongodb.org/manual/reference/operator/aggregation/substr/
If expression comes in from Teiid, then that could be issue. Is there capability not to allow expressions in Functions?
> MongoDB: Function substring - starting index and number of arguments
> --------------------------------------------------------------------
>
> Key: TEIID-2988
> URL: https://issues.jboss.org/browse/TEIID-2988
> Project: Teiid
> Issue Type: Bug
> Components: Misc. Connectors
> Affects Versions: 8.4.1
> Reporter: Filip Elias
> Assignee: Ramesh Reddy
> Labels: Beta1
> Fix For: 8.8, 8.7.1
>
>
> Two minor bugs in function substring()
> Mongo's function $substr takes only 3 arguments so this query fails:
> {code}
> SELECT intkey, SUBSTRING(BQT1.SmallA.stringkey, 1) FROM BQT1.SmallA ORDER BY intkey
> {code}
> {code}
> Exception:13:18:48,220 ERROR [org.teiid.CONNECTOR] (Worker38_QueryProcessorQueue345) Connector worker process failed for atomic-request=omsmHP0o16Sa.40.0.86: com.mongodb.CommandFailureException: { "serverUsed" : "localhost/127.0.0.1:27017" , "errmsg" : "exception: the $substr operator requires 3 operand(s)" , "code" : 16020 , "ok" : 0.0}
> at com.mongodb.CommandResult.getException(CommandResult.java:71)
> at com.mongodb.CommandResult.throwOnError(CommandResult.java:110)
> at com.mongodb.DBCollection.aggregate(DBCollection.java:1308)
> {code}
> Generated mongo command:
> {code}
> { aggregate: "smalla", pipeline: [ { $project: { c_0: "$INTKEY", c_1: { $substr: [ "$STRINGKEY", 1 ] } } }, { $sort: { c_0: 1 } } ] }
> {code}
> Mongo's $substr function second argument represents number of bytes to skip, not the starting index. The function substring(StringKey,1,1) returns the second letter, but it should return the first letter.
--
This message was sent by Atlassian JIRA
(v6.3.8#6338)
10 years, 1 month
[JBoss JIRA] (TEIID-2988) MongoDB: Function substring - starting index and number of arguments
by Steven Hawkins (JIRA)
[ https://issues.jboss.org/browse/TEIID-2988?page=com.atlassian.jira.plugin... ]
Steven Hawkins commented on TEIID-2988:
---------------------------------------
>From the latest commit, is it possible to have a non-literal index argument?
> MongoDB: Function substring - starting index and number of arguments
> --------------------------------------------------------------------
>
> Key: TEIID-2988
> URL: https://issues.jboss.org/browse/TEIID-2988
> Project: Teiid
> Issue Type: Bug
> Components: Misc. Connectors
> Affects Versions: 8.4.1
> Reporter: Filip Elias
> Assignee: Ramesh Reddy
> Labels: Beta1
> Fix For: 8.8, 8.7.1
>
>
> Two minor bugs in function substring()
> Mongo's function $substr takes only 3 arguments so this query fails:
> {code}
> SELECT intkey, SUBSTRING(BQT1.SmallA.stringkey, 1) FROM BQT1.SmallA ORDER BY intkey
> {code}
> {code}
> Exception:13:18:48,220 ERROR [org.teiid.CONNECTOR] (Worker38_QueryProcessorQueue345) Connector worker process failed for atomic-request=omsmHP0o16Sa.40.0.86: com.mongodb.CommandFailureException: { "serverUsed" : "localhost/127.0.0.1:27017" , "errmsg" : "exception: the $substr operator requires 3 operand(s)" , "code" : 16020 , "ok" : 0.0}
> at com.mongodb.CommandResult.getException(CommandResult.java:71)
> at com.mongodb.CommandResult.throwOnError(CommandResult.java:110)
> at com.mongodb.DBCollection.aggregate(DBCollection.java:1308)
> {code}
> Generated mongo command:
> {code}
> { aggregate: "smalla", pipeline: [ { $project: { c_0: "$INTKEY", c_1: { $substr: [ "$STRINGKEY", 1 ] } } }, { $sort: { c_0: 1 } } ] }
> {code}
> Mongo's $substr function second argument represents number of bytes to skip, not the starting index. The function substring(StringKey,1,1) returns the second letter, but it should return the first letter.
--
This message was sent by Atlassian JIRA
(v6.3.8#6338)
10 years, 1 month
[JBoss JIRA] (TEIID-2882) Add support for Presto DB
by Ramesh Reddy (JIRA)
[ https://issues.jboss.org/browse/TEIID-2882?page=com.atlassian.jira.plugin... ]
Work on TEIID-2882 started by Ramesh Reddy.
-------------------------------------------
> Add support for Presto DB
> -------------------------
>
> Key: TEIID-2882
> URL: https://issues.jboss.org/browse/TEIID-2882
> Project: Teiid
> Issue Type: Feature Request
> Components: Misc. Connectors
> Reporter: Van Halbert
> Assignee: Ramesh Reddy
> Fix For: 8.10
>
>
> Presto is an open source distributed SQL query engine for running interactive analytic queries against data sources of all sizes ranging from gigabytes to petabytes.
> Presto was designed and written from the ground up for interactive analytics and approaches the speed of commercial data warehouses while scaling to the size of organizations like Facebook.
--
This message was sent by Atlassian JIRA
(v6.3.8#6338)
10 years, 1 month
[JBoss JIRA] (TEIID-3216) Implement INSERT, UPDATE and DELETE support for google-spreadsheet connector
by Steven Hawkins (JIRA)
[ https://issues.jboss.org/browse/TEIID-3216?page=com.atlassian.jira.plugin... ]
Steven Hawkins commented on TEIID-3216:
---------------------------------------
If you are not using a batched update, then all you can do is return a single indicator of rows updated - the EXECUTE_FAILED and SUCCESS_NO_INFO would not be used. If there is a failure you can either throw an exception or attach a warning ExecutionContext.addWarning. A warning is probably more appropriate if the update can be partial.
> Implement INSERT, UPDATE and DELETE support for google-spreadsheet connector
> ----------------------------------------------------------------------------
>
> Key: TEIID-3216
> URL: https://issues.jboss.org/browse/TEIID-3216
> Project: Teiid
> Issue Type: Task
> Components: Misc. Connectors
> Reporter: Filip Elias
> Assignee: Filip Elias
> Fix For: Open To Community
>
>
> Current plan is to use list-based feed of the Google Data API[1].
> There are three known issues:
> performance - to delete/update 100 rows Teiid must generate 100 http requests
> consistency - user wants to update 50 rows. After the 10th row is updated the connection could fail which would cause that 10 rows would be updated and 40 wouldn't.
> headers - update, delete and and insert statements will be supported only for the spreadsheets that have a header for each column (headers are in the first row of a spreadsheet)
> Select statement is implemented using Google Visualisation API, but this API doesn't support updates and doesn't return row numbers.
> [1] https://developers.google.com/google-apps/spreadsheets/
--
This message was sent by Atlassian JIRA
(v6.3.8#6338)
10 years, 1 month
[JBoss JIRA] (TEIID-3216) Implement INSERT, UPDATE and DELETE support for google-spreadsheet connector
by Filip Elias (JIRA)
[ https://issues.jboss.org/browse/TEIID-3216?page=com.atlassian.jira.plugin... ]
Filip Elias commented on TEIID-3216:
------------------------------------
Currently I add into the update count array the number of actual updated rows + I log warning if some rows haven't been updated.
When should I add -3 (Statement.EXECUTE_FAILED) or -2 (Statement.SUCCESS_NO_INFO) into the update count array? I am not using batched update.
> Implement INSERT, UPDATE and DELETE support for google-spreadsheet connector
> ----------------------------------------------------------------------------
>
> Key: TEIID-3216
> URL: https://issues.jboss.org/browse/TEIID-3216
> Project: Teiid
> Issue Type: Task
> Components: Misc. Connectors
> Reporter: Filip Elias
> Assignee: Filip Elias
> Fix For: Open To Community
>
>
> Current plan is to use list-based feed of the Google Data API[1].
> There are three known issues:
> performance - to delete/update 100 rows Teiid must generate 100 http requests
> consistency - user wants to update 50 rows. After the 10th row is updated the connection could fail which would cause that 10 rows would be updated and 40 wouldn't.
> headers - update, delete and and insert statements will be supported only for the spreadsheets that have a header for each column (headers are in the first row of a spreadsheet)
> Select statement is implemented using Google Visualisation API, but this API doesn't support updates and doesn't return row numbers.
> [1] https://developers.google.com/google-apps/spreadsheets/
--
This message was sent by Atlassian JIRA
(v6.3.8#6338)
10 years, 1 month