BigData JAQ入门


启动

下载安装后,从目录来看,只支持linux的命令行。

直接进入到jaql目录,运行jaqlShell即可,为了方便,export到PATH变量中。

$ jaqlShell

Initializing Jaql.
Starting DataNode 0 with dfs.data.dir: \tmp\jaql\dfs\dfs\data\data1,\tmp\jaql\df       s\dfs\data\data2
Waiting for the Mini HDFS Cluster to start...
Generating rack names for tasktrackers
Generating host names for tasktrackers

jaql>

数组操作

定义数组:

jaql> array = [1,2,3,4];

jaql> array2=range(0,100);

数组其它操作

jaql> array[0];
1

jaql> array2[0:10];
[
  0,
  1,
  2,
  3,
  4,
  5,
  6,
  7,
  8,
  9,
  10
]
替换元素

jaql> array=replaceElement(array,0,10);

jaql> array;
[
  10,
  2,
  3,
  4
]

JSON操作

定义JSON
jaql> persons=[{name:‘Mary‘,age:40,children:[‘Katie‘,‘Rose‘]},{name:‘Mark‘,age:20}];

jaql> persons;
[
  {
    "name": "Mary",
    "age": 40,
    "children": [
  "Katie",
  "Rose"
]
  },
  {
    "name": "Mark",
    "age": 20
  }
]

获取部分行数据

jaql> persons[0];
{
  "name": "Mary",
  "age": 40,
  "children": [
  "Katie",
  "Rose"
]
}

jaql> persons[0].name;
"Mary"

jaql> persons[0].children[0];
"Katie"

获取部分列数据

jaql> persons[*].name;
[
  "Mary",
  "Mark"
]

jaql> persons[*].children;
[
  [
    "Katie",
    "Rose"
  ],
  null
]



BigData JAQ入门

上一篇:Ubuntu上交叉编译libusb (1.0.9 & compat-0.1.4对旧版本兼容usb.h包和库)


下一篇:动态显示表数据解决方案