kdb - 表列定义
问题描述
kdb+ 中使用了许多技巧来处理键控/展开/分区和简单的表。我看到许多.Q
功能作为这些品种的外观。其中之一是cols
。你能帮我处理一个案例吗?这个11h=
案例代表什么?
cols
k){$[
.Q.qp x:.Q.v x; / If partitioned
.Q.pf,!+x; / add "partitioned field" to table cols
98h=@x; / If simple table
!+x; / just table cols (convert to dict of lists, get keys)
11h=@!x; / ?
!x;
!+0!x / (keys-dict)!(data-dict): remove keys, get table cols
]}
解决方案
它适用于字典:
q)cols`a`b`c!1 2 3
`a`b`c
其中@
键 ( ) 的类型 ( !
) 是符号列表 ( 11h
)
推荐阅读
- javascript - Django项目中的JSONDecodeError
- node.js - AWS EKS - 协调器错误无法自动发现子网
- bash - 比较 csv 和 txt 文件以查找重复项并写入新的 csv 文件
- c# - C#字符串排序与前导十进制数?
- ruby-on-rails - 运行系统测试的新 Rails 项目出现 loaderror
- ios - 有没有办法在自定义属性包装器上实现 @AppStorage?
- c# - 在页面上查找文本,如果找不到,请转到下一页。硒 C#
- c# - ASPNET Web Api 中的 Json 格式
- java - @KafkaListener:通过传入参数生成clientId和groupId
- r - 模型验证有问题。这是选择模型后的下一步吗?