Date: Fri, 29 Mar 2024 15:31:05 +0100 (CET) Message-ID: <818676527.173.1711722665734@vmisdata19.uni-oldenburg.de> Subject: Exported From Confluence MIME-Version: 1.0 Content-Type: multipart/related; boundary="----=_Part_172_477222489.1711722665734" ------=_Part_172_477222489.1711722665734 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Content-Location: file:///C:/exported.html
This Operator can be used to update the timestamp information in= the meta data part. It can be used, if the generell Window operator does not help.
Be careful because this may lead undefined semantics.
/// Exam= ple using attributes for timestamp output =3D Timestamp({year=3D'year', month=3D'month', day=3D'day', hour=3D'= hour', minute=3D'minute', second=3D'second', millisecond=3D'millisecond'}, = input) /// Example using date format output =3D Timestamp({start=3D'timestamp', dateformat=3D'EEE MMM dd HH:mm:s= s zzz yyyy'}, input) /// Example with german time stamps output =3D Timestamp({start=3D'timestamp',dateformat =3D 'dd.MM.yyyy HH:mm:= ss'}, input) /// Simulate an Expression based window: output =3D Timestamp({start=3D'start', end =3D 'start+1000'},input) /// Create windows starting at distinct points in time, e.g. a "month"-base= d window (where the input attribute timestamp is a String based date repres= entation): ouput =3D TIMESTAMP({START =3D 'toLong(monthStart(toDate(timestamp,"dd.MM.y= yyy")))', END =3D 'toLong(nextMonthStart(toDate(timestamp,"dd.MM.y= yyy")))'},input)
Remark: This operator can be used to update the end tim= e stamp in cases where system time is used also (de.uniol.inf.is.odyss= eus.core.server.planmanagement.TransformationException: transformation fail= ed ; You cannot use start and end parameters for system time processing). I= n this case simply use the operator with systemtime=3Dfalse:
map =3D= MAP({EXPRESSIONS =3D [['TimeInterval.Start+1000','EndTS']], KEEPINPUT =3D = true}, nexmark:person) out =3D TIMESTAMP({end=3D'EndTS', SYSTEMTIME =3D false}, map)
Sometimes there are problem with some date string. The following example= from Tankerkoenig data shows how to handle such cases:
#PARSER= PQL #ADDQUERY in =3D CSVFILESOURCE({ schema =3D [ ['date', 'STRING'], ['station_uuid','STRING'], ['diesel','FLOAT'], ['e5','FLOAT'], ['e10','FLOAT'], ['dieselchange','BOOLEAN'], ['e5change','BOOLEAN'], ['e10change','BOOLEAN'] ], READFIRSTLINE =3D false, filename =3D 'D:/tankerkoenig-data/prices/2023/01/2023-01-01-pric= es.csv', source =3D 'Tanker-2023-01-01' =20 } =20 ) /// E.g. if you want to remove +01 from 2023-01-01 00:00:10+01 yyyy-MM-DD H= H:mm:ssZ tsCorrected =3D TIMESTAMP({START =3D 'toTimestamp(substring(date,0,19),"yyy= y-MM-dd HH:mm:ss")'}, in)