博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Elasticsearch-SQL
阅读量:7015 次
发布时间:2019-06-28

本文共 1315 字,大约阅读时间需要 4 分钟。

Elasticsearch-SQL

fork from
visit to feel.

features

All features following require ES with groovy script enabled.
  • Distinct precision_threshold depends on ES or you can specify by second parameters.When you have lot of shards, 40000  consume too much memory. 
  • select,groupBy now support functions and field alias 
  • nested function is also available,eg.  split(substring('newtype',0,3),'c')[0]
  • Binary operation support now, eg.  floor(substring(newtype,0,14)/100)/5)*5

functions support

  • floor
  • split
  • trim
  • log
  • log10
  • substring
  • round
  • sqrt
  • concat_ws
  • +
  • -
  • /
  • %

Example

check Example file:
org.nlpcn.es4sql.Test
SQLs:
SELECT newtype as nt  from  twitter2 SELECT sum(num) as num2,newtype as nt  from  twitter2 group by nt  order by num2 SELECT sum(num_d) as num2,split(newtype,',') as nt  from  twitter2 group by nt  order by num2SELECT sum(num_d) as num2,floor(num) as nt  from  twitter2 group by floor(num),newtype  order by num2SELECT split('newtype','b')[1] as nt,sum(num_d) as num2   from  twitter2 group by ntSELECT split(substring('newtype',0,3),'c')[0] as nt,num_d   from  twitter2 group by ntSELECT trim(newtype) as nt from  twitter2SELECT floor(floor(substring(time,0,14)/100)/5)*5 as nt,count(distinct(mid)) as cvalue FROM twitter2  where ty='buffer' and day='20160815' and domain='baidu.com' group by nt order by cvalue

转载地址:http://plhtl.baihongyu.com/

你可能感兴趣的文章
AMD宣布修复RX480供电Bug 性能还提速3%
查看>>
联想武汉工厂因暴雨断电 每日损失利润百万?
查看>>
撬动智能家居市场 智慧家庭“最强大脑”被激活
查看>>
聊聊springcloud的GatewayControllerEndpoint
查看>>
聊聊sentinel的SentinelResourceAspect
查看>>
聊聊flink的SpoutWrapper
查看>>
聊聊flink的StateDescriptor
查看>>
git 使用教程,常用命令
查看>>
使用SVI实现Vlan间路由
查看>>
Linux学习笔记5月28日任务
查看>>
解决Td内容为空时不显示边框的问题-兼容IE、firefox、chrome
查看>>
SylixOS x86中断探测(二)
查看>>
HDFS总结
查看>>
scala 中导出excel
查看>>
Zend Studio 10正式版注册破解(2013-03-20更新)
查看>>
CentOS 7 借用debian kernel 4.9
查看>>
jni
查看>>
贪婪匹配和非贪婪匹配
查看>>
精通Hyperledger之fabric环境搭建-mac版(1.1)
查看>>
.NET中的DRY和SHY原则
查看>>