代码拉取完成,页面将自动刷新
基于SparkSQL实现了一套即席查询服务,具有如下特性:
支持的数据源:hdfs、hive、hbase、kafka、mysql、es
支持的文件格式:parquet、csv、orc、json、text
在Structured Streaming支持的Sink之外还增加了对Hbase、MySQL、es的支持
使用方式:
load hbase.t_mbl_user_version_info
where `spark.table.schema`="userid:String,osversion:String,toolversion:String"
and `hbase.table.schema`=":rowkey,info:osversion,info:toolversion"
and `hbase.zookeeper.quorum`="localhost:2181"
as tb;
参数 | 说明 | 默认值 |
---|---|---|
hbase.zookeeper.quorum | zookeeper地址 | localhost:2181 |
spark.table.schema | Spark临时表对应的schema(eg: "ID:String,appname:String,age:Int") | 无 |
hbase.table.schema | HBase表对应schema(eg: ":rowkey,info:appname,info:age") | 无 |
spark.rowkey.view.name | rowkey对应的dataframe创建的temp view名 ,设置了该值后只获取rowkey对应的数据 | 无 |
使用方式:
save tb1 as hbase.tableName
where `hbase.zookeeper.quorum`="localhost:2181"
and `hbase.table.rowkey.filed`="name"
参数 | 说明 | 默认值 |
---|---|---|
hbase.zookeeper.quorum | zookeeper地址 | localhost:2181 |
hbase.table.rowkey.field | spark临时表中作为hbase的rowkey的字段名 | 第一个字段 |
bulkload.enable | 是否启动bulkload | false |
hbase.table.name | Hbase表名 | 无 |
hbase.table.family | 列族名 | info |
hbase.table.region.splits | 预分区分区段,以数组字符串方式指定,如 ['1','2','3'] | 无 |
hbase.table.rowkey.prefix | 当rowkey是数字,预分区需要指明前缀的formate形式,如 00,在startKey和endKey都未设置的情况下会生成00-99等100个分区 | 无 |
hbase.table.startKey | 预分区开始key,当hbase表不存在时,会自动创建Hbase表,不带一下三个参数则只有一个分区 | 无 |
hbase.table.endKey | 预分区结束key | 无 |
hbase.table.numReg | 分区个数 | 无 |
hbase.check_table | 写入hbase表时,是否需要检查表是否存在 | false |
hbase.cf.ttl | ttl | 无 |
load jdbc.ai_log_count
where driver="com.mysql.jdbc.Driver" // 默认
and url="jdbc:mysql://localhost/db?characterEncoding=utf8"
and user="root" // 默认
and password="***" //默认
as tb;
save append tb as jdbc.aatest_delete;
load format.`path` as tb;
save tb as formate.`path` partitionBy uid coalesce 2;
load kafka.`topicName`
where maxRatePerPartition="200"
and `group.id`="consumerGroupId"
register udf.`myupper`
where func="
def apply(name:String)={
name.toUpperCase
}
";
load jsonStr.'
{"name":"ufo"}
{"name":"uu"}
{"name":"HIN"}
' as tb1;
select myupper(name) as newName from tb1;
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。