测试代码如下: /* 创建三个分布式表: dfs://test_1/test_1 dfs://test_2/test_2 dfs://test_3/test_3 */ def createDBAndTable(dbName, tbName) { db = database(dbName, VALUE, 0..1) model = table(1:0, `id`value, [INT, FLOAT]) createPartitionedTable(db, model, tbName, `id) append!(loadTable(db, tbName),...
回答于 2022-06-11 21:59
查看当前节点连接: getConnections() 查看当前集群中所有数据节点连接: // 方式1 pnodeRun(getConnections) // 方式2 rpc(getControllerAlias(), getClusterPerf).connectionNum
回答于 2022-06-11 21:55
使用元编程方式,动态传入、解析列名Vector。 示例代码如下: t = table(1 as Volume1, 2 as Volume2, 3 as Volume3, 4 as Volume4, 5 as Volume5, 6 as Volume6, 7 as Volume7, 8 as Volume8, 9 as Volume9, 10 as Volume10) sql(select=sqlCol("Volume" + string(1..10)), from=t).eval()
回答于 2022-06-02 18:38
t = table(1..5 as `202120, 1..5 as value) select round(202120, 4) 202120 from t // 错误 select round(_"202120", 4) `202120 from t // 正确 查询时,如果数字开头列名,需要使用_这种方式。
回答于 2022-06-02 18:31
示例代码如下: def getRes(res_name, col_name) { dict_res = dict(`吊牌销售额`期初库存额`在途订单`可用库存, 1.0 2.0 3.0 4.0) return table(sqlColAlias(<dict_res[res_name]>, col_name).eval()) } res_name = `期初库存额 col_name = `指标值 getRes(res_name, col_name)
回答于 2022-06-02 18:21
form 5 表示字典,其余各个数字含义详见:数据形式 type 0 表示空值即NULL,其余各个数字含义详见:数据类型 这个错误含义是说,API 端构造的数据存在问题,导致Server 端无法反序列化。建议看下哪个字段是字典且赋了空值,尝试修改下这个字段,然后重新写入试下。
回答于 2022-06-02 09:21
Remote Directory 这个字段不为空时,我们右键选中一个脚本或者一个目录,Synchronize to server 子菜单会高亮显示,我们可以同步一个脚本或者目录到Remote Directory 指定目录下,然后通过 run scripts 这种方式运行脚本。
回答于 2022-06-02 09:16
示例代码如下: foo 调用了funcB,查看funcB 被哪些函数调用。 def funcB(a) { return a * 2 } def foo(a) { return 1 + funcByName(a) } select name from defs() where userDefined = true, each(x -> funcByName(x).string(), name) like "%funcB%"
回答于 2022-06-02 09:13
使用clearAllCache 一次性异步清理所有缓存,包括:分布式表已经载入内存中的数据,以及分布式计算Map Reduce任务的中间结果。根据warningMemSize 自动清理的话,使用的是LRU算法。 不会stop the world。
回答于 2022-06-02 09:05