[JBoss JIRA] (TEIID-3501) IN clause - teradata does not support "CAST( ... AS ...)" statement in "IN(...)"
by Steven Hawkins (JIRA)
[ https://issues.jboss.org/browse/TEIID-3501?page=com.atlassian.jira.plugin... ]
Steven Hawkins commented on TEIID-3501:
---------------------------------------
It seems odd, but an IN predicate for teradata can contain only a single expression or a list of literals - http://www.info.teradata.com/HTMLPubs/DB_TTU_14_00/index.html#page/SQL_Re...
> IN clause - teradata does not support "CAST( ... AS ...)" statement in "IN(...)"
> --------------------------------------------------------------------------------
>
> Key: TEIID-3501
> URL: https://issues.jboss.org/browse/TEIID-3501
> Project: Teiid
> Issue Type: Bug
> Affects Versions: 8.7.1.6_2
> Environment: teradata version: 15
> Reporter: Juraj Duráni
> Assignee: Steven Hawkins
>
> The teradata DB does not support CAST statement in IN. Query (1), teradata exception (2), source specific command (3), query that teradata accepts (4).
> (1) SELECT BQT1.SmallA.IntKey FROM BQT1.SmallA WHERE BQT1.SmallA.TimeStampValue IN (convert('2000-01-01 00:00:12.0', timestamp), convert('2000-01-01 00:00:45.0', timestamp)) ORDER BY IntKey
> (2) SELECT g_0.intkey AS c_0 FROM smalla AS g_0 WHERE g_0.timestampvalue IN (cast('2000-01-01 00:00:12.0' AS TIMESTAMP(6)), cast('2000-01-01 00:00:45.0' AS TIMESTAMP(6))) ORDER BY 1
> (3) SELECT g_0.intkey AS c_0 FROM smalla AS g_0 WHERE g_0.timestampvalue IN ('2000-01-01 00:00:12.0', '2000-01-01 00:00:45.0') ORDER BY 1
> (4) Caused by: java.sql.SQLException: [Teradata Database] [TeraJDBC 15.10.00.05] [Error 3706] [SQLState 42000] Syntax error: expected something between ')' and ','.
> at com.teradata.jdbc.jdbc_4.util.ErrorFactory.makeDatabaseSQLException(ErrorFactory.java:308)
> ...
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)
10 years, 10 months
[JBoss JIRA] (TEIID-3474) Inconsistent results of RIGHT function for different datasources
by Steven Hawkins (JIRA)
[ https://issues.jboss.org/browse/TEIID-3474?page=com.atlassian.jira.plugin... ]
Steven Hawkins commented on TEIID-3474:
---------------------------------------
Ok, yes those results are correct given the conversion of doublenum to string - which for teradata uses scientific notation. This falls under the general caveat we have that the source conversions to string are not always the same as the engine. In situations where it causes a user an issue though we do see if a fix is appropriate.
> Inconsistent results of RIGHT function for different datasources
> ----------------------------------------------------------------
>
> Key: TEIID-3474
> URL: https://issues.jboss.org/browse/TEIID-3474
> Project: Teiid
> Issue Type: Bug
> Components: JDBC Connector
> Affects Versions: 7.7
> Environment: OS: Fedora 20
> arch: x86_64
> java: oracle 1.8
> Reporter: Juraj Duráni
> Assignee: Steven Hawkins
> Fix For: 8.7.1.6_2, 8.11
>
>
> The RIGHT function returns different results for different datasources. Some of those results are inconsistent with definition of the RIGHT(x,y) function.
> =======
> +*Query: SELECT intkey, RIGHT(intkey, 1) FROM table ORDER BY intkey*+
> *Teradata, SQLServer, Sybase, Ingres, MySQL, Oracle (this result is OK):*
> 0 0
> 1 1
> 2 2
> ...
> 10 0
> 11 1
> ...
> 100 0
> 101 1
> *Postgres:*
> 0 0
> 1 1
> 2 2
> ...
> 10 10
> 11 11
> ...
> 100 100
> 101 101
> *DB2:*
> 0 " "
> 1 " "
> 2 " "
> ...
> 10 " "
> 11 " "
> ...
> 100 " "
> 101 " "
> =====
> +*Query:SELECT intkey, RIGHT(intkey, 2) FROM table ORDER BY intkey*+
> *SQLServer, Sybase, Ingress, MySQL, Teradata (this result is OK):*
> 0 0
> 1 1
> ...
> 10 10
> 11 11
> ...
> 100 00
> 101 01
> *Oracle:*
> 0 <null>
> 1 <null>
> 2 <null>
> ...
> 10 10
> 11 11
> ...
> 100 00
> 101 01
> *Postgres:*
> 0 0
> 1 1
> 2 2
> ...
> 10 10
> 11 11
> ...
> 100 100
> 101 101
> *DB2:*
> 0 " "
> 1 " "
> 2 " "
> ...
> 10 " "
> 11 " "
> ...
> 100 " "
> 101 " "
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)
10 years, 10 months
[JBoss JIRA] (TEIID-3505) MySQL translator (mysql, mysql5) - convert( ..., float [double]) uses "+ 0.0" construction
by Steven Hawkins (JIRA)
[ https://issues.jboss.org/browse/TEIID-3505?page=com.atlassian.jira.plugin... ]
Steven Hawkins resolved TEIID-3505.
-----------------------------------
Fix Version/s: 8.11
Resolution: Done
Added nesting parens.
There is also the potential that we'll need to better map to floating point conversions (which mysql doesn't seem to help with) as those currently just use the + 0.0 so they are still effectively decimal values.
> MySQL translator (mysql, mysql5) - convert( ..., float [double]) uses "+ 0.0" construction
> -------------------------------------------------------------------------------------------
>
> Key: TEIID-3505
> URL: https://issues.jboss.org/browse/TEIID-3505
> Project: Teiid
> Issue Type: Bug
> Affects Versions: 8.7.1.6_2
> Reporter: Juraj Duráni
> Assignee: Steven Hawkins
> Fix For: 8.11
>
>
> convert(... , float) and convert(..., double) functions use for conversion "+ 0.0". But if the result is used in the more complex expression, translator does not take into account priority of the operators.
> *Query:* SELECT StringKey, (convert(StringKey, float)+(-3)) AS StringKeyPlusNeg3, (convert(StringKey, float) - (-3)) AS StringKeyMinusNeg3, (convert(StringKey, float)*(-3)) AS StringKeyTimesNeg3, (convert(StringKey, float)/(-3)) AS StringKeyDivNeg3 FROM table WHERE IntKey == 1 ORDER BY StringKey
> *Result:* 1 | -2 | 4 | 1 | 1
> *Source-specific query:* SELECT g_0.STRINGKEY AS c_0, (g_0.STRINGKEY + 0.0 + -3.0) AS c_1, (g_0.STRINGKEY + 0.0 - -3.0) AS c_2, _*(g_0.STRINGKEY + 0.0 * -3.0)*_ AS c_3, _*(g_0.STRINGKEY + 0.0 / -3.0)*_ AS c_4 FROM smalla AS g_0 WHERE g_0.INTKEY > 0 AND g_0.INTKEY <= 10 ORDER BY c_0
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)
10 years, 10 months
[JBoss JIRA] (TEIID-3204) Admin shell throws an IncompatibleClassChangeError
by RH Bugzilla Integration (JIRA)
[ https://issues.jboss.org/browse/TEIID-3204?page=com.atlassian.jira.plugin... ]
RH Bugzilla Integration commented on TEIID-3204:
------------------------------------------------
Van Halbert <vhalbert(a)redhat.com> changed the Status of [bug 1161428|https://bugzilla.redhat.com/show_bug.cgi?id=1161428] from MODIFIED to ON_QA
> Admin shell throws an IncompatibleClassChangeError
> --------------------------------------------------
>
> Key: TEIID-3204
> URL: https://issues.jboss.org/browse/TEIID-3204
> Project: Teiid
> Issue Type: Bug
> Components: Tools
> Affects Versions: 8.7.1
> Environment: OS: fedora 20
> arch: x86_64
> java: oracle 1.7
> Reporter: Juraj Duráni
> Assignee: Van Halbert
> Fix For: 8.7.1.6_2
>
>
> Admin shell throws an IncompatibleClassChangeError when wrong path to groovy script is provided along with load command.
> Actual result:
> ===> [import static org.teiid.adminshell.AdminShell.*; import static org.teiid.adminshell.GroovySqlExtensions.*; import org.teiid.adminapi.*;]
> FATAL: java.lang.IncompatibleClassChangeError: the number of constructors during runtime and compile time for java.lang.Exception do not match. Expected 4 but got 5
> java.lang.IncompatibleClassChangeError: the number of constructors during runtime and compile time for java.lang.Exception do not match. Expected 4 but got 5
> at groovy.lang.MetaClassImpl.selectConstructorAndTransformArguments(MetaClassImpl.java:1406)
> at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.selectConstructorAndTransformArguments(ScriptBytecodeAdapter.java:237)
> at org.codehaus.groovy.tools.shell.CommandException.<init>(Command.groovy:60)
> at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
> at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
> at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
> at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
> ....
> ....
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)
10 years, 10 months