All Forums Aster
toadrw 69 posts Joined 07/04
24 Oct 2013
Aster nPath Functionality Example error

Hello:
I'm trying to do the Aster nPath Functionality Volume II example from this link:
http://www.asterdata.com/download_aster_express/npath- functionality-vol2.php
And I'm getting the following error:

ERROR [42000] [AsterData][nCluster] (34) ERROR: column "_tmp_1894364208"."customer" does not exist ()

SELECT Command Failed.
I'm using the Aster Express system.  Could someone help me with the above error.  Thanks. 

CREATE FACT TABLE SavingsTrans

(customer varchar(10),

 eventtimestamp timestamp,

 amount integer)

DISTRIBUTE BY HASH (customer);

 

INSERT INTO SavingsTrans

VALUES('mark', '2011-03-01 00:00:00', 91);

INSERT INTO SavingsTrans

VALUES('mark', '2011-03-02 00:00:00', 501);

INSERT INTO SavingsTrans

VALUES('mark', '2011-03-03 00:00:00', 499);

INSERT INTO SavingsTrans

VALUES('mike', '2011-01-01 00:00:00', 1050);

INSERT INTO SavingsTrans

VALUES('mike', '2011-01-15 00:00:00', 1040);

INSERT INTO SavingsTrans

VALUES('mike', '2011-01-17 00:00:00', -50);

INSERT INTO SavingsTrans

VALUES('mike', '2011-01-19 00:00:00', 91);

INSERT INTO SavingsTrans

VALUES('mike', '2011-02-01 00:00:00', 1051);

INSERT INTO SavingsTrans

VALUES('mike', '2011-02-14 00:00:00', 1059);

 

SELECT customer, 

last_2, 

Time2 - Time1 AS Time_Lag 

FROM nPath

(ON (SELECT * FROM SavingsTrans WHERE Amount > 0)

PARTITION BY customer ORDER BY eventtimestamp

MODE (OVERLAPPING)

PATTERN('First500.Second500')

SYMBOLS (amount > 500 As First500, 

amount > 500 

AND LAG(amount, 1) >= (amount*.98)::int

AND LAG(amount,1) <= (amount*1.02)::int AS Second500)

RESULT (LAST(customer OF First500) AS customer,

 

ACCUMULATE(amount of any(First500, Second500)) AS LAST_2,

first(eventtimestamp of First500) As Time1,

first(eventtimestamp of Second500) AS Time2));
SELECT customer,
last_2,
Time2 - Time1 AS Time_Lag
FROM nPath
(ON (SELECT * FROM SavingsTrans WHERE Amount > 0)
PARTITION BY customer ORDER BY eventtimestamp
MODE (OVERLAPPING)
PATTERN('First500.Second500')
SYMBOLS (amount > 500 As First500,
amount > 500
AND LAG(amount, 1) >= (amount*.98)::int
AND LAG(amount,1) <= (amount*1.02)::int AS Second500)
RESULT (LAST(customer OF First500) AS customer,

ACCUMULATE(amount of any(First500, Second500)) AS LAST_2,
first(eventtimestamp of First500) As Time1,
first(eventtimestamp of Second500) AS Time2));
 

Tags:
jtbirdsell 1 post Joined 07/14
07 Jul 2014

I am having this same issue. Was this ever resolved?

Jordan Birdsell

ahsan.khan 4 posts Joined 07/14
21 Oct 2014

I now do not get the error 4200. What I did was just run all the commands above, (the last SQL-MR command is repeated so skipped second time), and here's the result I get

customer |    last_2    | time_lag
----------+--------------+----------
 mike     | [1051, 1059] | 13 days
 mike     | [1050, 1040] | 14 days
(2 rows)

I'm using Aster Express 6.0

You must sign in to leave a comment.