Advanced Capstone

Hi, I’m having an issue with 2.2, I don’t understand why the test is failing here:

I have defined my lapTable as follow:

c | t f a -----------| ----- date | d sensorId | s p session | s lapId | j time | t endTime | t sensorValue| f

the rows and columns of this table are matching the one  above the question

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 2020.01.02 tempBackLeft P3 5 12:16:52.146 12:17:12.914 20.61416 2020.01.02 tempBackLeft P3 6 12:17:12.914 12:17:30.610 20.62186

However, I’m getting a length error in the test

quizItem success description error --------------------------------------------------------------------------------------------------------------------------------------------------------------------- exercise2.1 Pass “check if race day in process” “” exercise2.1 Pass “have correct schema” “” exercise2.2 Pass “check if lap table in process” “” exercise2.2 Pass “only contains data for 2nd Jan 2020” “” exercise2.2 Fail “contain all columns for 2nd Jan 2020” “length”

I don’t understand what I’m doing wrong here, could someone explain me.

Hi  , I agree your table structure and first few rows of lapTable look correct at a glance.

See the underlying test cases for this exercise are printed here which should help in debugging why the the second test is failing, note it compares against the table lap on disk which might be your issue.

 

 

Hi Michaela,

Thank you for your response. 

However, I’m not able to access the link you sent

 

Apologies - updated link is https://community.kx.com/t5/KX-Academy/Re-Advanced-Capstone-Quiz-2-2-2-and-2-2-3/m-p/11046/highlight/true#M31

I found the issue, many thanks!

I have another issue with test 3.2, I have defined the .perm.users table using the csv and encoding the passwords but the test is also failing, would you know what I’m doing wrong here ?

quizItem success description error ---------------------------------------------------------------------- exercise3.2 Fail “check password col is updated” “”

this is the structure of the table I have defined:

c | t f a --------| ----- user | s password| X api | s

This is how I’m building the table:

 

.perm.users:1!update password:.Q.sha1 each password from flip userpasswordapi!("S*S";"\t") 0: :/opt/kx/developer/workspace/ nouser /adv_capstone/AdvancedCapstone.Data/users.txt

 

Look at your first row in the table - there is an additional record when comparing with users.txt as the column headers are being added to the table as records.

Hint - search “enlist” on this page to see an example of how you can do this without needing to define the column headers explicitly.

I got it sorted, thank you so much for your help ! 

Hi  , I’m not able to pass just one test case of 2.2

Kindly suggest.

#spoiler

get hsym $getenv[AX_WORKSPACE],“/f1”

lapTable: get `:2020.01.02/lap

lapTable: update date:2020.01.02 from lapTable

lapTable:select date,sensorId,session,lapId,time,endTime,sensorValue from lapTable

 

 

Hi  You can use select to call the table from memory, you should not be dropping the date column and then adding it back in.

Not sure that will fix your issue - can you run meta and count on lapTable and screenshot here please so I can better advise?

Hi Thanks for the response  

This is the response of count and meta.

I don’t think so there is any column as date in the lap table from exercise 1.

Hi  - the date should be added in exercise 1.4 which saves the table down to disk with date partition.

Then in 2.2 you should read from that table on disk back into memory.

// Exercise 1.4 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]; saveDB:hsym $getenv[AX_WORKSPACE],“/f1” // Save data to date partitioned table .Q.dpft[saveDB;2020.01.02;sensorId;lap]; // Exercise 2.2 // Check were we are and cd if needed \pwd \cd .. // Load in database post changes \l f1 meta lap // see date is added lapTable:select from lap where date in 2020.01.02

 

 

 

Thanks