Not sure if it is useful as it is only checking columns in some table to pass the test?
But here is it
path_lap_20200102:$":",getenv[AX_WORKSPACE],"/f1/2020.01.02/lap" lapTable:update date:2020.01.02 from get path_lap_20200102 /lapTable:select date:2020.01.02, sensorId, session, lapId, time, endTime, sensorValue from get path_lap_20200102
Note: it is not well rendered, so you might not see some characters
@jeanluck watch the order of your columns as per the sample table, date should be out in front. Another way to load in partitioned data WITH date column already added so you dont have to add it in manually using update and then reordering columns is using select from statement instead of get
@mwoods I am not sure to understand: my lap table on disk does not contain a date column, that's why I added it manually because if I added a date column, exercise1.4 will fail.
OK, following what you said that I don't need to add a date column manually, it means that at exercise1.4, I need to add the column date: maybe I did a mistake on exercise1.4.
After I added the column date and all columns in the order in exercise1.4, exercise2.2 passed.
lap:select date:2020.01.02, sensorId, session, lapId, time, endTime, sensorValue from .f1.createLapTable[tlap;tsensor] .Q.dpft[path_f1;2020.01.02;date;lap]
Then I don't understand what this error means?
exercise1.4 Fail "create col files for lap table" ""
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 Fail "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 Fail "create col files for lap table" "" exercise1.5 Pass ".d file should consist of all col names" ""
After writing table to disk using .Q.dpft and loading into memory you should see the date column on your table. You do not need to pass the column name date as in your example, the third parameter should be the column to key on, in this case sensorId. See an example here of what that looks like: https://code.kx.com/q/ref/dotq/#dpft-save-table
Note in that example the table in memory is first deleted and then the table on disk is reloaded - only after loading from disk does date then appear when calling the table or using meta. So for exercise 2.2 you should see date appear without needing to do anything other load table into memory as long as your .Q.dpft worked correctly.
If you can get all your exercise 1 passing thats a good sign .Q.dpft worked correctly. Then use \l to load into memory.
@mwoods There is something not clear or not mentioned in the instruction.
In exercise1.4, does "lap" table saved on the disk contains the "date" column or not? Because it is not mentioned or no sample provided of the output columns. I am asking this because originally, to pass the test in exercise1.4, I didn't add the the "date" column on "lap" table on the disk but it will break the test in exercise2.2.
On exercise2.2, it seems that if you want to pass the test, you need the "date" column in "lap" table saved on the disk with "date" as the third parameter in .Q.dpft. Otherwise the test will fail in exercise2.2.
I was thinking there is potential discrepancy between test and instruction as I found that in exercise3.5, instruction talked about "?" but test description talked about "!" and when I replaced "?" by "!", the test passed.
@mwoods I am still stuck and could not do anything because there are interdependencies to pass both tests: - if 1.4 pass, I have to make 2.2 failed - if 2.2 pass, I have to make 1.4 failed So I don't really know if the test has some errors like 3.5 in fact.
Ok, if you are saying that in 1.4, the "date" column should be on disk in addition to columns returned by ".f1.createLapTable", then you are saying my real issue lies in 1.4. But to make 2.2 passed, in 1.4, I have to pass "date" as the 3rd parameter in ".Q.dpft" and not "sensorId". Then 1.4 will fail as we added extra "date" column in addition to columns returned by ".f1.createLapTable". You can check in test code for 1.4 and 2.2 to know why maybe?
For 3.5, in the instruction, it is said that if there is no function, it should return "?". But the test description is "return ! if given update query" which means we should return "!" instead then the test passed.
@jeanluck to get you unblocked quickly it will be best if you can share your answers file with me in a DM or to evangelism@kx.com. Then I can better investigate what is going wrong for you as is hard to diagnose without seeing what you have ran.