I need help with ex2.1 for the fundamental capstone project
2.1 In the optRef table, the expiry column is in a string format. Convert this into the kdb date format.
My solution:
update expiry: $[“D”;expiry] from optRef
I cast within the sql query using UPDATE and cast from string to date using $[x;y] which works except that I cannot keep the changes in my optRef table as it is not updating.
Apparently the exercise 1 test doesn’t really check the table, only that it exists.
According to the description, getOptionRef takes a list of IDs, but you are passing in a symbol, and due to some bad luck this doesn’t result in a type error but the function returns all the rows matching your symbol which there are none.
The test checks for an exact match with the expected table, not just the schema. Can you check if you created the optRef table correctly? How many rows are there in the table?
Thanks for the reply, you were right about using the assignment to update the table:
optRef : update expiry: $["D";expiry] from optRef
To make sure the change is applied to the table of the datatype for the expiry column to date. However I came across another problem (I think it might be the date format but not sure) : when I pass the ex2 test function ex2.1 fails, even though all the column have the correct datatypes.
when I call the refServiceget handle for ex1.4 I get just the columns, so I have no observations.
How I created optRef table:
optRef: refServiceHandle(getOptionRef,uniqueOpts)
I assumed my optRef table was correct as it passed the ex1 function test, but now I think I may have called the refServiceHandle function incorrectly and the optRef table wrong (ex1.4) as there are 0 rows.
will not work - I’m not sure how that is working for you as it’s throwing a nyi error. You need to select from the table before you can exec on partitioned on-disk tables.
I also don’t see where you load the messages csv - did you use the table importer?
All tests for section 1 and 2 pass when I run through it with those couple of things corrected.