我从Timescale网站下载了一个样本数据集(https://timescaledata.blob.core.windows.net/datasets/devices_big.tar.gz),then,如下所示将其导入到DolphinDB中。
FP_DEVICES = 'C:/Users/xjqian/Downloads/devices_big/'
FP_INFO = FP_DEVICES + 'devices_big_device_info.csv'
FP_READINGS = FP_DEVICES + 'devices_big_readings.csv'
FP_DB = FP_DEVICES + 'db/'
COLS_INFO = `device_id`api_version`manufacturer`model`os_name
COLS_READINGS = `time`device_id`battery_level`battery_status`battery_temperature`bssid`cpu_avg_1min`cpu_avg_5min`cpu_avg_15min`mem_free`mem_used`rssi`ssid
TYPES_INFO = `SYMBOL`SYMBOL`SYMBOL`SYMBOL`SYMBOL
TYPES_READINGS = `DATETIME`SYMBOL`INT`SYMBOL`DOUBLE`SYMBOL`DOUBLE`DOUBLE`DOUBLE`LONG`LONG`SHORT`SYMBOL
schema_info = table(COLS_INFO, TYPES_INFO)
schema_readings = table(COLS_READINGS, TYPES_READINGS)
device_info = loadText(FP_INFO, , schema_info)
TIME_RANGE = 2016.11.15T00:00:00 + 86400 * 0..4
ID_RANGE = ('demo' + lpad((0..10 * 300)$STRING, 6, "0"))$SYMBOL
time_schema = database('', RANGE, TIME_RANGE)
id_schema = database('', RANGE, ID_RANGE)
db = database(FP_DB, COMPO, [time_schema, id_schema])
readings = loadTextEx(db, `readings, `time`device_id, FP_READINGS, , schema_readings)
然后我想完全连接两个表,我在GUI中执行以下代码,
readings = loadTable(FP_DB, `readings, , true)
fj(device_info,readings, 'device_id')
以下发生错误,
2019-04-28T14:34:11.743: execution was completed with exception
Please use SQL statements for table joins involving partitioned tables.
如何完全连接这些表?