Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
447 views
in Technique[技术] by (71.8m points)

KDB/Q splayed table column type changing from 0h to 77h

I have a table that has some columns of type 0h with normal strings in them. Meta shows type C.

I am saving this table to a splayed DB with

.Q.dpft[hsym `$path; dt;`sym;`t]]

However when I load the splayed table later

l path_to_my_table

the type of all 0h columns changes to 77h. How can I avoid that? I am using 3.6


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

As a means of giving you a means to answer the question and decide engineering tradeoffs - not because I believe introducing new code for this is the best way to go about it - you might consider how this is avoided when writing to TP logs (-11! cannot stream from anymap files).

This was a consideration in some of our test code when my team looked at this upgrade in 2019, and we wrote a generic routine to take a list of input and manually write it to a TP log format. Repurposing for your use, it would be something like:

f:get`:file
h:hopen hdel`:file
h f
hclose h

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...