1.from表函数
1.1 hdfs
格式:hdfs(url,format,struct)
代码:
select
toInt32OrNull(id) ,
name ,
job
from
hdfs('hdfs://linux01:8020/doit18/user2.csv' ,'CSV','id String ,name String,job String');
1.2 file
格式:file(path,format,struct)
代码:
select
*
from
file('/data','CSV','uid String,name String');
1.3mysql
格式:mysql(url,database,table,用户名,密码)
代码:
select
*
from
mysql('hadoop01:3306','demo','tb_mysql','root','root');
2limit by
格式:limit n by 字段
含义:根据指定字段,每个字段显示n条数据
select *
from
tb_shop
order by name ,ctime
limit 3 by name
3 order by 和with
代码:
select *
from
tb_shop
order by
cost
with fill from 200 to 800 step 100;
上述代码段含义:根据cost字段排序,从200到800每个100显示一次数据