All 2 tests passed
2023.08.01 01:55 PM
quizItem success description error
------------------------------------------------------------------------
exercise1.1 Pass "column file in DB should be renamed to lapId" ""
exercise1.1 Pass ".d file in DB should be renamed to lapId" ""
exercise1.1 Pass "all column files should be in event dir" ""
exercise1.2 Pass "lapId should exist in event table" ""
exercise1.3 Fail "check if all values are correct" ""
exercise1.4 Pass "check if lap table exists" ""
exercise1.4 Pass "create new lap dir in f1 DB" ""
exercise1.4 Pass "create col files for lap table" ""
exercise1.4 Pass ".d file should consist of all col names" ""
exercise1.5 Pass "check if lap table exists in date dir" ""
exercise1.5 Pass "create col files for lap table" ""
exercise1.5 Pass ".d file should consist of all col names" ""
meta lap shows
c | t f a
-----------| -----
date | d
session | s p
lapId | j
time | t
endTime | t
sensorId | s
sensorValue| f
count lap shows 410
first few rows of lap shows
date session lapId time endTime sensorId sensorValue
-------------------------------------------------------------------------------------
2020.01.02 P3 1 12:00:42.329 12:01:14.042 windSpeedFront 159.7311
2020.01.02 P3 1 12:00:42.329 12:01:14.042 windSpeedBack 159.7292
2020.01.02 P3 1 12:00:42.329 12:01:14.042 tyrePressureFrontRight 203.8121
2020.01.02 P3 1 12:00:42.329 12:01:14.042 tyrePressureFrontLeft 203.8102
2020.01.02 P3 1 12:00:42.329 12:01:14.042 tyrePressureBackRight 203.8104
2020.01.02 P3 1 12:00:42.329 12:01:14.042 tyrePressureBackLeft 203.8072
and I used the test data and all seemed correct. Not sure why test is not passing.
Thanks
2023.08.10 01:52 AM
@rmcfee825 The selecting of the columns is not required around the wj
.f1.createLapTable:{[eventTab;sensorTab]
crossTab:(select from eventTab) cross distinct select sensorId from sensorTab;
w:(crossTab[`time];crossTab[`endTime]);
res:wj[w;`sensorId`time;select from crossTab;(select from sensorTab;(avg;`sensorValue))];
delete date from res
}
2023.08.03 11:01 AM
Check the columns sequences, mine passed and correct order is
c | t f a
-----------| -----
date | d
sensorId | s p
session | s
lapId | j
time | t
endTime | t
sensorValue| f
quizItem success description error
------------------------------------------------------------------------
exercise1.1 Pass "column file in DB should be renamed to lapId" ""
exercise1.1 Pass ".d file in DB should be renamed to lapId" ""
exercise1.1 Pass "all column files should be in event dir" ""
exercise1.2 Pass "lapId should exist in event table" ""
exercise1.3 Pass "check if all values are correct" ""
exercise1.4 Pass "check if lap table exists" ""
exercise1.4 Pass "create new lap dir in f1 DB" ""
exercise1.4 Pass "create col files for lap table" ""
exercise1.4 Pass ".d file should consist of all col names" ""
exercise1.5 Pass "check if lap table exists in date dir" ""
exercise1.5 Pass "create col files for lap table" ""
exercise1.5 Pass ".d file should consist of all col names" ""
2023.08.04 03:04 AM
Looks like count and meta are different, they should be:
//"meta lap"
c | t f a
-----------| -----
date | d
sensorId | s p
session | s
lapId | j
time | t
endTime | t
sensorValue| f
// "count lap"
210
//"lap"
date sensorId session lapId time endTime sensorValue
-----------------------------------------------------------------------------
2020.01.02 tempBackLeft P3 1 12:00:42.329 12:01:14.042 20.61488
2020.01.02 tempBackLeft P3 2 12:01:14.042 12:02:27.094 20.62392
2020.01.02 tempBackLeft P3 3 12:02:27.094 12:02:54.318 20.61883
2020.01.02 tempBackLeft P3 4 12:02:54.318 12:16:52.146 20.621
If still stuck can add your code with the spoiler feature (in toolbar - click three dots ) then I can better suggest where you might be going wrong.
2023.08.06 01:32 PM
Hi,
I defined .f1.createLapTable as
and afterwards applied asc so I can apply the parted attribute.
2023.08.08 03:33 AM
Hi @rmcfee825 you're very nearly there.
The date column should be removed in .f1.createLapTable for 1.3 to pass. And you do not need to explicitly add the parted attribute. These both should come when you save lap down to disk in exercise 1.4. Date gets added and parted attribute gets applied when you use
.Q.dpft
I would recommend the Partitioned Tables course to help you get familiar with the basics of saving tables to disk that will help with this project.
2023.08.08 06:03 AM
Hi @Michaela,
Thanks for clarifying! I did remove the date column by
doing the following select statement
lap:select asc sensorId,session,lapId,time, endTime, sensorValue from lap;
but I will do that in the function instead then.
However, the count is still wrong as I am getting 410 instead of 210 in your solution.
Thanks
2023.08.08 07:03 AM
@rmcfee825 is 1.3 passing after you moved that piece inside the function? I would expect yes as I tried your code on my side and it looks correct and passes for me. You can open the unit for this function which might help debug further if not
feature .f1.createLapTable
before
.test.lapTable:([]date:2#2020.01.02;session:2#`P3;lapId:1 1;time:13:00:00.00 13:02:48.156;endTime:13:02:48.156 13:04:57.689);
.test.sensorTable:([]date:6#2020.01.02;sensorId:((2#`tempBackLeft),(2#`tempBackRight),2#`tyrePressureBackLeft);time:13:00:00.00+6?3000;lapId:6#1;units:((4#`degreesCel),2#`pascals);sensorValue:((20+4?1.),200+2?1.);session:6#`P3);
should Each Sensor Should Have Start Time From Lap Table
expect
((3#13:00:00.000),3#13:02:48.156)~exec time from .f1.createLapTable[.test.lapTable;.test.sensorTable]
should Each Sensor Should Have End Time From Lap Table
expect
((3#13:02:48.156),3#13:04:57.689)~exec endTime from .f1.createLapTable[.test.lapTable;.test.sensorTable]
For number of rows is that for 1.4 after saving lap to disk? This might be due to tables you are passing to the function rather than the function itself.
lap:.f1.createLapTable[select from event where date in 2020.01.02, session in `P3;select from sensor where date in 2020.01.02, session in `P3]
2023.08.08 12:02 PM
Hi,
Tests passed
All 2 tests passed
210
2023.08.09 06:40 AM
@rmcfee825 I don't see where are you deleting date within the function?
2023.08.09 09:09 AM
Hi,
Even with the delete I am having issues.
still shows
exercise1.3 Fail "check if all values are correct" ""
while I am running
2023.08.10 01:52 AM
@rmcfee825 The selecting of the columns is not required around the wj
.f1.createLapTable:{[eventTab;sensorTab]
crossTab:(select from eventTab) cross distinct select sensorId from sensorTab;
w:(crossTab[`time];crossTab[`endTime]);
res:wj[w;`sensorId`time;select from crossTab;(select from sensorTab;(avg;`sensorValue))];
delete date from res
}
3 weeks ago
Thank you!
EMEA
Tel: +44 (0)28 3025 2242
AMERICAS
Tel: +1 (212) 447 6700
APAC
Tel: +61 (0)2 9236 5700
KX. All Rights Reserved.
KX and kdb+ are registered trademarks of KX Systems, Inc., a subsidiary of FD Technologies plc.