[JBoss JIRA] (TEIID-1869) Simple capabilities with PostgreSQL 8.3 using decodeinteger causes comm failure
by Paul Nittel (Created) (JIRA)
Simple capabilities with PostgreSQL 8.3 using decodeinteger causes comm failure
-------------------------------------------------------------------------------
Key: TEIID-1869
URL: https://issues.jboss.org/browse/TEIID-1869
Project: Teiid
Issue Type: Bug
Components: Query Engine
Affects Versions: 7.6
Reporter: Paul Nittel
Assignee: Steven Hawkins
We use PostgreSQL 8.3 twice: once to test push-down to the source and the other to test not-pushed-down queries. The following works fine with the push-down. It's not so good when we use simple-capabilities.
The query is:
SELECT IntKey, BooleanValue, DECODEINTEGER(BooleanValue, 'false,3,true,7') AS Decoded FROM BQT1.SmallA ORDER BY IntKey
What happens is:
$ ./RunQT jdbc:teiid:QT_PostgreSQL83@mm://localhost:31000 user user yes "SELECT IntKey, BooleanValue, DECODEINTEGER(BooleanValue, 'false,3,true,7') AS Decoded FROM BQT1.SmallA ORDER BY IntKey"
Caught SQLException:
[SingleInstanceCommunicationException]
1 [EOFException]
In the case of query testing, all subsequent queries fail due to a closed socket error.
Dev indicated "That's a bug with the rewriter. We are just converting the decode function into a searched case statement, but are leaving the then values as string - rather than converting them to integers. The pushdown works because the resulting string value is converted to an integer via the translator/driver logic."
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
12 years
[JBoss JIRA] (TEIID-1902) Update extension metadata property keys
by Steven Hawkins (JIRA)
Steven Hawkins created TEIID-1902:
-------------------------------------
Summary: Update extension metadata property keys
Key: TEIID-1902
URL: https://issues.jboss.org/browse/TEIID-1902
Project: Teiid
Issue Type: Task
Components: Misc. Connectors, Query Engine
Affects Versions: 7.6.1
Reporter: Steven Hawkins
Assignee: Steven Hawkins
Priority: Critical
As per a discussion with designer folks we will now index extension property keys that are more fool-proof in Clark notation:
{nsURI}key
Any reference to an extension property key will need to be updated with the proper uri. For the time being any lookup that was using a valid old key will use both the old and the new form for backwards compatibility. Also the use of an extension property in the ldap translator should be changed to use the standard format metadata property.
We should also touch on property keys in our developer's guide.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
12 years
[JBoss JIRA] (TEIID-1841) week function in teiid not returning expected value
by Graeme Gillies (Created) (JIRA)
week function in teiid not returning expected value
---------------------------------------------------
Key: TEIID-1841
URL: https://issues.jboss.org/browse/TEIID-1841
Project: Teiid
Issue Type: Bug
Affects Versions: 7.5
Environment: Teiid 7.5 running on java 1.6 openjdk on rhel5
Reporter: Graeme Gillies
Assignee: Steven Hawkins
One of our users of our teiid instance as reported that the week function (to determine which week of the year it is) operates in teiid a little different to how they expect.
Teiid resets the week count to 1 on every 1st of January even though
the day is not the 1st day of the week (Sunday in here).
But Postgres will only resets the week count to 1 only on the 1st Monday
of the year.
The examples below compare the results return by teiid and Postgres:
{noformat}
# Teiid result:
EngVDBR=> select week(parsedate('2011-01-01', 'yyyy-MM-dd')) AS Week;
week
------
1
(1 row)
EngVDBR=> select week(parsedate('2011-01-02', 'yyyy-MM-dd')) AS Week;
week
------
2
(1 row)
{noformat}
{noformat}
# Postgres result:
postgres=> SELECT EXTRACT(WEEK FROM DATE '2011-01-01') AS Week;
week
------
52
(1 row)
postgres=> SELECT EXTRACT(WEEK FROM DATE '2011-01-03') AS Week;
week
------
1
(1 row)
{noformat}
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
12 years
[JBoss JIRA] Created: (TEIID-1604) Rationalize the context objects
by Steven Hawkins (JIRA)
Rationalize the context objects
-------------------------------
Key: TEIID-1604
URL: https://issues.jboss.org/browse/TEIID-1604
Project: Teiid
Issue Type: Quality Risk
Components: Connector API, Query Engine
Affects Versions: 8.0
Reporter: Steven Hawkins
Assignee: Steven Hawkins
Fix For: 8.0
The the CommandContext and the ExecutionContext should have their methods rationalized so that there is a uniform way to access information (ExecutionContext.getCommandContext().getSession().getUsername() vs. ExecutionContext.getUserName()) and/or at least ensure that method names are the same.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
12 years
[JBoss JIRA] (TEIID-1933) 0 size CLOBs in teiid cause unexpected problems
by Graeme Gillies (JIRA)
Graeme Gillies created TEIID-1933:
-------------------------------------
Summary: 0 size CLOBs in teiid cause unexpected problems
Key: TEIID-1933
URL: https://issues.jboss.org/browse/TEIID-1933
Project: Teiid
Issue Type: Bug
Affects Versions: 7.6
Environment: java version "1.6.0_20"
OpenJDK Runtime Environment (IcedTea6 1.9.10) (rhel-1.23.1.9.10.el5_7-x86_64)
OpenJDK 64-Bit Server VM (build 19.0-b09, mixed mode)
Running on RHEL 5, teiid 7.6 inside of JBoss EAP 5.1.1
teiid has had the fix in TEIID-1927 applied
Reporter: Graeme Gillies
Assignee: Steven Hawkins
Hi,
this issue is similar to the issue in TEIID-1927, but this time, we are experiencing similar problems when other code is inadvertently calling getSubString on 0 sized CLOB objects from teiid
An example is below that takes some data from teiid and tries to put it into a mysql database
{code}
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.ResultSetMetaData;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.ArrayList;
import java.util.Iterator;
import org.teiid.jdbc.TeiidDataSource;
public class TestMain {
private static final String host = "vdb.example.com";
private static final String port = "31000";
private static final String vdb = "EngVDBR";
private static final String user = "user";
private static final String password = "user";
private static final int batchSize = 50000;
public static void main(String[] args) throws Exception {
new TestMain();
}
public TestMain() {
try {
System.out.println("Executing using the TeiidDriver");
Connection connSrc = getSrcConnection();
Connection connTar = getTarConnection();
ArrayList<String> batches = getBatches(getCount(connSrc, "Bugzilla.bugs", "1 = 1"));
System.out.println(batches.size());
Iterator<String> it = batches.iterator();
while (it.hasNext()) {
String str = "select keywords from Bugzilla.bugs order by bug_id "
+ it.next();
System.out.println(str);
execute(connSrc, str, connTar);
}
} catch (Exception e) {
e.printStackTrace();
}
}
static Connection getSrcConnection() throws Exception {
String url = "jdbc:teiid:" + vdb + "@mms://" + host + ":" + port
+ ";showplan=on";
Class.forName("org.teiid.jdbc.TeiidDriver");
return DriverManager.getConnection(url, user, password);
}
static Connection getTarConnection() throws Exception {
String url = "jdbc:mysql://localhost:3306/test";
Class.forName("com.mysql.jdbc.Driver");
return DriverManager.getConnection(url, "test", "test");
}
static Connection getDataSourceConnection() throws Exception {
TeiidDataSource ds = new TeiidDataSource();
ds.setDatabaseName(vdb);
ds.setUser(user);
ds.setPassword(password);
ds.setServerName(host);
ds.setPortNumber(Integer.valueOf(port));
ds.setShowPlan("on");
return ds.getConnection();
}
public static void execute(Connection connSrc, String sql,
Connection connTar) throws Exception {
try {
Statement statement = connSrc.createStatement(
ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY);
// statement.setFetchSize(5000);
ResultSet results = statement.executeQuery(sql);
ResultSetMetaData metadata = results.getMetaData();
int columns = metadata.getColumnCount();
connTar.setAutoCommit(false);
PreparedStatement ps = connTar
.prepareStatement("insert into bugs values("
+ getColStr(columns) + ")");
System.out.println("insert into bugs values(" + getColStr(columns)
+ ")");
for (int row = 1; results.next(); row++) {
for (int i = 1; i <= columns; i++) {
// System.out.println(results.getObject(i));
ps.setObject(i, results.getObject(i));
}
ps.executeUpdate();
}
connTar.commit();
results.close();
statement.close();
} catch (SQLException e) {
e.printStackTrace();
System.exit(1);
} finally {
}
}
public ArrayList<String> getBatches(int tabCnt) {
ArrayList<String> batches = new ArrayList<String>();
int batchLen = 0;
int init = 0;
int endNum = 0;
if (tabCnt % batchSize == 0) {
batchLen = tabCnt / batchSize;
} else {
batchLen = tabCnt / batchSize + 1;
}
for (int i = 0; i < batchLen; i++) {
batches.add(" limit " + init + ", " + batchSize);
endNum = init + batchSize;
init = endNum;
}
return batches;
}
public int getCount(Connection conn, String table, String condition) {
try {
Statement stmt = conn.createStatement();
ResultSet rs = stmt.executeQuery("select count(1) from "
+ table + " where " + condition);
if (rs.next()) {
return rs.getInt(1);
}
} catch (Exception e) {
}
return 0;
}
public static String getColStr(int columnCount) {
StringBuffer sb = new StringBuffer();
for (int i = 0; i < columnCount; i++) {
sb.append("?,");
}
String str = sb.toString();
return str.substring(0, str.length() - 1);
}
}
{code}
Which throws the following error
{noformat}
Executing using the TeiidDriver
13
select keywords from Bugzilla.bugs order by bug_id limit 0, 50000
insert into bugs values(?)
javax.sql.rowset.serial.SerialException: Invalid position in BLOB object set
at javax.sql.rowset.serial.SerialClob.getSubString(SerialClob.java:246)
at com.mysql.jdbc.PreparedStatement.setClob(PreparedStatement.java:3553)
at com.mysql.jdbc.PreparedStatement.setObject(PreparedStatement.java:3979)
at com.redhat.com.hss.etl.util.TestMain.execute(TestMain.java:93)
at com.redhat.com.hss.etl.util.TestMain.<init>(TestMain.java:40)
at com.redhat.com.hss.etl.util.TestMain.main(TestMain.java:25)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:616)
at org.apache.tools.ant.taskdefs.ExecuteJava.run(ExecuteJava.java:217)
at org.apache.tools.ant.taskdefs.ExecuteJava.execute(ExecuteJava.java:152)
at org.apache.tools.ant.taskdefs.Java.run(Java.java:764)
at org.apache.tools.ant.taskdefs.Java.executeJava(Java.java:218)
at org.apache.tools.ant.taskdefs.Java.executeJava(Java.java:132)
at org.apache.tools.ant.taskdefs.Java.execute(Java.java:105)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:616)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.Target.execute(Target.java:357)
at org.apache.tools.ant.Target.performTasks(Target.java:385)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1337)
at org.apache.tools.ant.Project.executeTarget(Project.java:1306)
at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
at org.apache.tools.ant.Project.executeTargets(Project.java:1189)
at org.apache.tools.ant.Main.runBuild(Main.java:758)
at org.apache.tools.ant.Main.startAnt(Main.java:217)
at org.apache.tools.ant.launch.Launcher.run(Launcher.java:257)
at org.apache.tools.ant.launch.Launcher.main(Launcher.java:104)
{noformat}
On closer inspection it looks like inside the mysql driver it's calling getSubString(1, 0) on the object because the CLOB object is size 0, which is the problem in the first place.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
12 years
[JBoss JIRA] (TEIID-1903) count() function with salesforce adaptor not behaving correctly
by Graeme Gillies (JIRA)
Graeme Gillies created TEIID-1903:
-------------------------------------
Summary: count() function with salesforce adaptor not behaving correctly
Key: TEIID-1903
URL: https://issues.jboss.org/browse/TEIID-1903
Project: Teiid
Issue Type: Bug
Components: Salesforce Connector
Affects Versions: 7.5
Environment: java version "1.6.0_20"
OpenJDK Runtime Environment (IcedTea6 1.9.10) (rhel-1.23.1.9.10.el5_7-x86_64)
OpenJDK 64-Bit Server VM (build 19.0-b09, mixed mode)
on
Red Hat Enterprise Linux Server release 5.7 (Tikanga)
Reporter: Graeme Gillies
Assignee: Steven Hawkins
Hi,
I noticed the following strange behaviour with the salesforce connector. In the below example, Bugzilla is normal JDBC datasource to a mysqldb, while SFDC is a salesforce.com datasource
{noformat}
EngVDBR=> select count(*) from Bugzilla.bugs;
count
--------
604680
(1 row)
EngVDBR=> select count(*) from SFDC.salesforce.Case_;
count
--------
455487
(1 row)
EngVDBR=> select count(1) from SFDC.salesforce.Case_;
ERROR: SalesforceAPI: The number of result rows has exceeded the maximum result rows "100,000"
DETAIL: org.teiid.jdbc.TeiidSQLException: SalesforceAPI: The number of result rows has exceeded the maximum result rows "100,000"
EngVDBR=> select count(1) from Bugzilla.bugs;
count
--------
604680
(1 row)
EngVDBR=>
{noformat}
I would have expected count(1) on salesforce to work the same as count(*), but it returns the maxrows error even though it should only return one row.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
12 years