cancel
Showing results for 
Search instead for 
Did you mean: 

How the sym file reads data from partition table?

hzadonis369
New Contributor II

Hi, Masters:

  Last week, I created a partition table to store fundmental data, for example, Sector A has 10 equities and Sector B has 8 equities. The data changed day by day and was loaded by a csv file which exported from Stock Exchange system. It works fine last week.
  As you know, Feb 18 and 19 is weekend. Today, Feb 20 is Monday, there's trouble. The same script that imports csv file into kdb partition table has problem. The Sector data was disrupted, I tested with a temp table, such as:
  sect:(" SS"; enlist ",") 0:`E:/App/datafile/Sector.csv;
  But after write to parition table it is totally different from the temp table:
  (hsym `$parSectorpath) set .Q.en[hsym `$dbpath, ";"] sect;
  \l E:/App/db
  At the same time, there's a strange folder named "db;" which contains a sym file was generated under the App path.
 I try to use the sym file to replace the old one, the historical data and today's data are all disrupted, because the number of Sector is not the same as last week. So, can I sure it was caused by the sym file? How can I fix it?
 
Thanks!
1 ACCEPTED SOLUTION

gyorokpeter-kx
New Contributor III
New Contributor III

Why do you have  `$dbpath, ";" ? If dbpath is "db" then that would explain why you are seeing a "db;" directory.

This way, the sym file from this operation is created in the "db;" directory, and the symbol indices in the table will point to this new sym file. You can't swap in and out sym files with each other if there are existing symbol references to it, because then they will point to the wrong symbol. Instead you could load the "wrong" sym file, de-enumerate the symbol columns, and then call .Q.en again but this time with the correct database path.

View solution in original post

2 REPLIES 2

gyorokpeter-kx
New Contributor III
New Contributor III

Why do you have  `$dbpath, ";" ? If dbpath is "db" then that would explain why you are seeing a "db;" directory.

This way, the sym file from this operation is created in the "db;" directory, and the symbol indices in the table will point to this new sym file. You can't swap in and out sym files with each other if there are existing symbol references to it, because then they will point to the wrong symbol. Instead you could load the "wrong" sym file, de-enumerate the symbol columns, and then call .Q.en again but this time with the correct database path.

Hi, gyorokpeter-kx: Thanks! you're right. It's stupid that add a ";" at the end of "dbpath".   It's works fine now!