dropColumns!
语法
dropColumns!(table, colNames)
别名:drop!
参数
table 一个内存表或分布式表(仅支持 OLAP 引擎)。
colNames 表示列名的标量或向量。若 table 是分布式表,则 colNames 只能是标量。
详情
从表中删除指定的列。请注意,对于分布式表,不支持分区列和 SYMBOL 类型列的删除。
例子
t=table(1 2 3 as x, 4 5 6 as y, 7..9 as z, 10..12 as a, 13..15 as b, 16..18 as c);
t;
| x | y | z | a | b | c |
|---|---|---|---|---|---|
| 1 | 4 | 7 | 10 | 13 | 16 |
| 2 | 5 | 8 | 11 | 14 | 17 |
| 3 | 6 | 9 | 12 | 15 | 18 |
t.dropColumns!(`x);
| y | z | a | b | c |
|---|---|---|---|---|
| 4 | 7 | 10 | 13 | 16 |
| 5 | 8 | 11 | 14 | 17 |
| 6 | 9 | 12 | 15 | 18 |
dropColumns!(t, `a`b);
| y | z | c |
|---|---|---|
| 4 | 7 | 16 |
| 5 | 8 | 17 |
| 6 | 9 | 18 |
