可以使用writeRecord 函数,示例代码如下:
n = 10000 t = table(rand(1..100, n) as id, rand(100.0, n) as value) f = file("/hdd/hdd0/jtwang/data/xinfei/test_export.bin", "w") writeRecord(f, t)
这个函数目前有些限制,对于字符串类型不支持,可以使用API 规避一下,Python API示例代码如下:
binFile = open("D:/Work/test_import.bin", 'wb+') pickle.dump(contextDF, binFile) binFile.close()