Skip to content
This repository has been archived by the owner on Jun 7, 2021. It is now read-only.

Fix for udr/TEST001 test failure #1150

Merged
merged 1 commit into from Jun 28, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
31 changes: 19 additions & 12 deletions core/sql/regress/udr/EXPECTED001
Expand Up @@ -285,7 +285,8 @@ CREATE TABLE_MAPPING FUNCTION TRAFODION.SCH.SESSIONIZE_JAVA
+> PARTITION BY 1 ORDER BY 2),
+> 'USERID',
+> 'TS',
+> 60000000));
+> 60000000))
+>ORDER BY 2, 1, 3;

(EXPR) USERID SESSION_ID IPADDR
--------------- -------------------------------- -------------------- ---------------
Expand All @@ -306,7 +307,8 @@ CREATE TABLE_MAPPING FUNCTION TRAFODION.SCH.SESSIONIZE_JAVA
+> PARTITION BY 1 ORDER BY 2),
+> 'USERID',
+> 'TS',
+> 60000000));
+> 60000000))
+>ORDER BY 2, 1, 3;

(EXPR) USERID SESSION_ID IPADDR
--------------- -------------------------------- -------------------- ---------------
Expand All @@ -324,7 +326,8 @@ CREATE TABLE_MAPPING FUNCTION TRAFODION.SCH.SESSIONIZE_JAVA
+> PARTITION BY 1 ORDER BY 2),
+> 'USERID',
+> 'TS',
+> 60000000));
+> 60000000))
+>ORDER BY 2, 1, 3;

(EXPR) USERID SESSION_ID IPADDR
--------------- -------------------------------- -------------------- ---------------
Expand All @@ -343,15 +346,16 @@ CREATE TABLE_MAPPING FUNCTION TRAFODION.SCH.SESSIONIZE_JAVA
+> PARTITION BY ipaddr ORDER BY ts),
+> 'IPADDR',
+> cast('TS' as char(2)),
+> 60000000)) XO;
+> 60000000)) XO
+>ORDER BY ipaddr, session_id, sequence_no;

SESSION_ID SEQUENCE_NO USERID TS IPADDR
-------------------- -------------------- -------------------------------- -------------------- ---------------

1 1 super-user 212334861599500000 12.345.567.345
2 1 super-user 212334868799500000 12.345.567.345
2 2 super-services 212334868799500000 12.345.567.345
2 3 super-services 212334868799550000 12.345.567.345
1 1 super-user 212365360799500000 12.345.567.345
2 1 super-user 212365367999500000 12.345.567.345
2 2 super-services 212365367999500000 12.345.567.345
2 3 super-services 212365367999550000 12.345.567.345

--- 4 row(s) selected.
>>
Expand Down Expand Up @@ -430,7 +434,8 @@ SESSION_ID SEQUENCE_NO USERID TS
+> PARTITION BY 1 ORDER BY 2),
+> 'USERID',
+> 'TS',
+> 60000000));
+> 60000000))
+>ORDER BY 2, 1, 3;

(EXPR) USERID SESSION_ID IPADDR
--------------- -------------------------------- -------------------- ---------------
Expand All @@ -453,16 +458,18 @@ SESSION_ID SEQUENCE_NO USERID TS
+> 'IPADDR',
+> cast('TS' as char(2)),
+> 60000000)) XO
+>where session_id < 10;
+>where session_id < 10
+>ORDER BY 2, 1, 3;

--- SQL command prepared.
>>explain options 'f' s;

LC RC OP OPERATOR OPT DESCRIPTION CARD
---- ---- ---- -------------------- -------- -------------------- ---------

5 . 6 root 1.79E+001
4 . 5 esp_exchange 1:4(hash2) 5.00E+001
6 . 7 root 1.79E+001
5 . 6 esp_exchange 1:4(hash2) (m) 5.00E+001
4 . 5 sort 5.00E+001
3 . 4 tmudf XO 5.00E+001
2 . 3 sort 1.00E+002
1 . 2 esp_exchange 4(hash2):1 1.00E+002
Expand Down
6 changes: 4 additions & 2 deletions core/sql/regress/udr/EXPECTED002
Expand Up @@ -6629,7 +6629,8 @@ LOG_TS SEVERITY COMPONENT
+> 'VAL1', 'FC',
+> 'VAL1', 'LC',
+> 'VAL2', 'FC',
+> 'VAL2', 'LC'));
+> 'VAL2', 'LC'))
+>order by p, slice_time;

P SLICE_TIME VAL1_FC VAL1_LC VAL2_FC VAL2_LC
----------- -------------------------- ----------- ----------- ------------ ------------
Expand Down Expand Up @@ -6693,7 +6694,8 @@ P SLICE_TIME VAL1_FC VAL1_LC VAL2_FC
+> 'VAL1', 'FLi',
+> 'VAL1', 'LLi',
+> 'VAL2', 'FLi',
+> 'VAL2', 'LLi'));
+> 'VAL2', 'LLi'))
+>order by p, slice_time;

P SLICE_TIME VAL1_FCI VAL1_LCI VAL2_FCI VAL2_LCI VAL1_FL VAL1_LL VAL2_FL VAL2_LL VAL1_FLI VAL1_LLI VAL2_FLI VAL2_LLI
----------- -------------------------- ----------- ----------- ------------ ------------ ------------------------- ------------------------- ------------------------- ------------------------- ------------------------- ------------------------- ------------------------- -------------------------
Expand Down
18 changes: 12 additions & 6 deletions core/sql/regress/udr/TEST001
Expand Up @@ -247,7 +247,8 @@ FROM UDF(sessionize_dynamic(TABLE(SELECT userid,
PARTITION BY 1 ORDER BY 2),
'USERID',
'TS',
60000000));
60000000))
ORDER BY 2, 1, 3;

SELECT cast(CONVERTTIMESTAMP(ts) as TIME(6)), userid, session_id, ipAddr
FROM UDF(sessionize_dynamic(TABLE(SELECT userid,
Expand All @@ -258,7 +259,8 @@ FROM UDF(sessionize_dynamic(TABLE(SELECT userid,
PARTITION BY 1 ORDER BY 2),
'USERID',
'TS',
60000000));
60000000))
ORDER BY 2, 1, 3;
SELECT cast(CONVERTTIMESTAMP(ts) as TIME(6)), userid, session_id, ipAddr
FROM UDF(sessionize_dynamic(TABLE(SELECT userid,
JULIANTIMESTAMP(ts) as TS,
Expand All @@ -268,7 +270,8 @@ FROM UDF(sessionize_dynamic(TABLE(SELECT userid,
PARTITION BY 1 ORDER BY 2),
'USERID',
'TS',
60000000));
60000000))
ORDER BY 2, 1, 3;

-- call sessionize_dynamic_shared, sharing the same DLL
SELECT *
Expand All @@ -279,7 +282,8 @@ FROM UDF(sessionize_dynamic_shared(TABLE(SELECT userid,
PARTITION BY ipaddr ORDER BY ts),
'IPADDR',
cast('TS' as char(2)),
60000000)) XO;
60000000)) XO
ORDER BY ipaddr, session_id, sequence_no;

-- uniqueness constraint avoids a groupby
explain options 'f'
Expand Down Expand Up @@ -324,7 +328,8 @@ FROM UDF(sessionize_java(TABLE(SELECT userid,
PARTITION BY 1 ORDER BY 2),
'USERID',
'TS',
60000000));
60000000))
ORDER BY 2, 1, 3;

-- uniqueness constraint avoids a groupby
prepare s from
Expand All @@ -337,7 +342,8 @@ FROM UDF(sessionize_java(TABLE(SELECT userid,
'IPADDR',
cast('TS' as char(2)),
60000000)) XO
where session_id < 10;
where session_id < 10
ORDER BY 2, 1, 3;
explain options 'f' s;
execute s;

Expand Down
6 changes: 4 additions & 2 deletions core/sql/regress/udr/TEST002
Expand Up @@ -209,7 +209,8 @@ from udf(timeseries(table(select * from t002_Timeseries
'VAL1', 'FC',
'VAL1', 'LC',
'VAL2', 'FC',
'VAL2', 'LC'));
'VAL2', 'LC'))
order by p, slice_time;

select *
from udf(timeseries(table(select * from t002_Timeseries
Expand All @@ -228,7 +229,8 @@ from udf(timeseries(table(select * from t002_Timeseries
'VAL1', 'FLi',
'VAL1', 'LLi',
'VAL2', 'FLi',
'VAL2', 'LLi'));
'VAL2', 'LLi'))
order by p, slice_time;

-- JDBC queries through a TMUDF. Note that this requires the Trafodion T4
-- driver jar to exist in $TRAF_HOME/udr/external_libs.
Expand Down