74
74
-- File Changelog
75
75
-- v.1.0 2019-10-29 First release
76
76
-- v.1.1 2020-04-02 Added change log; no code changes in present file
77
+ -- v.1.1.1 2020-04-24 Bug fix: Column "sampleid" confused with keyword
77
78
-- ------------------------------------------------------------------------------
78
79
79
80
@@ -179,6 +180,8 @@ DROP TABLE RFStateCodeModelsPy;
179
180
--
180
181
-- Before you execute the following statement, replace <DBNAME> with the
181
182
-- database name you specified in the beginning of Use Case [2] earlier.
183
+ -- In the following statement, the "sampleid" column of the input table is
184
+ -- enclosed in quotes to differentiate the name from the SQL keyword sampleid.
182
185
CREATE TABLE RFStateCodeModelsPy AS (
183
186
SELECT d .oc1 AS statecode,
184
187
d .oc2 AS rf_model
@@ -189,7 +192,7 @@ CREATE TABLE RFStateCodeModelsPy AS (
189
192
ck_acct_ind, sv_acct_ind, cc_acct_ind, ck_avg_bal,
190
193
sv_avg_bal, cc_avg_bal, ck_avg_tran_amt, sv_avg_tran_amt,
191
194
cc_avg_tran_amt, q1_trans_cnt, q2_trans_cnt,
192
- q3_trans_cnt, q4_trans_cnt, SAMPLE_ID
195
+ q3_trans_cnt, q4_trans_cnt, " sampleid "
193
196
FROM MultiModelTrain_Py)
194
197
PARTITION BY scode
195
198
SCRIPT_COMMAND(' python3 ./<DBNAME>/stoRFFitMM.py' )
@@ -229,6 +232,8 @@ call SYSUIF.install_file('stoRFScoreMM','stoRFScoreMM.py','cz!mmscoscrPATH');
229
232
--
230
233
-- Before you execute the following statement, replace <DBNAME> with the
231
234
-- database name you specified in the beginning of Use Case [2] earlier.
235
+ -- In the following statement, the "sampleid" column of the nested input table
236
+ -- is enclosed in quotes to differentiate the name from the SQL keyword sampleid.
232
237
SELECT d .oc1 AS cust_id,
233
238
d .oc2 AS statecode,
234
239
d .oc3 AS Prob0,
@@ -243,7 +248,7 @@ FROM SCRIPT( ON(SELECT s.*,
243
248
x .ck_acct_ind , x .sv_acct_ind , x .cc_acct_ind , x .ck_avg_bal ,
244
249
x .sv_avg_bal , x .cc_avg_bal , x .ck_avg_tran_amt , x .sv_avg_tran_amt ,
245
250
x .cc_avg_tran_amt , x .q1_trans_cnt , x .q2_trans_cnt ,
246
- x .q3_trans_cnt , x .q4_trans_cnt , x .SAMPLE_ID ,
251
+ x .q3_trans_cnt , x .q4_trans_cnt , x." sampleid " ,
247
252
row_number() OVER (PARTITION BY x .cust_id ORDER BY x .cust_id ) AS nRow
248
253
FROM MultiModelTest_Py x) AS s, RFStateCodeModelsPy m
249
254
WHERE s .scode = m .statecode )
0 commit comments