greenplum 数组操作
参考:http://gpdb.docs.pivotal.io/4390/admin_guide/query/topics/functions-operators.html
| Function | Return Type | Full Syntax | Description |
|---|---|---|---|
| matrix_add(array[], array[]) | smallint[], int[], bigint[], float[] | matrix_add( array[[1,1],[2,2]], array[[3,4],[5,6]]) | Adds two two-dimensional matrices. The matrices must be conformable. |
| matrix_multiply( array[], array[]) | smallint[]int[], bigint[], float[] | matrix_multiply( array[[2,0,0],[0,2,0],[0,0,2]], array[[3,0,3],[0,3,0],[0,0,3]] ) | Multiplies two, three- dimensional arrays. The matrices must be conformable. |
| matrix_multiply( array[], expr) | int[], float[] | matrix_multiply( array[[1,1,1], [2,2,2], [3,3,3]], 2) | Multiplies a two-dimensional array and a scalar numeric value. |
| matrix_transpose( array[]) | Same as input arraytype. | matrix_transpose( array [[1,1,1],[2,2,2]]) | Transposes a two-dimensional array. |
| pinv(array []) | smallint[]int[], bigint[], float[] | pinv(array[[2.5,0,0],[0,1,0],[0,0,.5]]) | Calculates the Moore-Penrose pseudoinverse of a matrix. |
| unnest (array[]) | set of anyelement | unnest( array['one', 'row', 'per', 'item']) | Transforms a one dimensional array into rows. Returns a set ofanyelement, a polymorphic pseudotype in PostgreSQL. |
| Function | Return Type | Full Syntax | Description |
|---|---|---|---|
| MEDIAN (expr) | timestamp, timestampz, interval, float | MEDIAN (expression)
Example: SELECT department_id, MEDIAN(salary) |
Can take a two-dimensional array as input. Treats such arrays as matrices. |
| PERCENTILE_CONT (expr) WITHIN GROUP (ORDER BYexpr [DESC/ASC]) | timestamp, timestampz, interval, float | PERCENTILE_CONT(percentage) WITHIN GROUP (ORDER BY expression)
Example: SELECT department_id, |
Performs an inverse function that assumes a continuous distribution model. It takes a percentile value and a sort specification and returns the same datatype as the numeric datatype of the argument. This returned value is a computed result after performing linear interpolation. Null are ignored in this calculation. |
| PERCENTILE_DISC (expr) WITHIN GROUP (ORDER BYexpr [DESC/ASC]) | timestamp, timestampz, interval, float | PERCENTILE_DISC(percentage) WITHIN GROUP (ORDER BY expression)
Example: SELECT department_id, |
Performs an inverse distribution function that assumes a discrete distribution model. It takes a percentile value and a sort specification. This returned value is an element from the set. Null are ignored in this calculation. |
| sum(array[]) | smallint[]int[], bigint[], float[] | sum(array[[1,2],[3,4]])
Example: CREATE TABLE mymatrix (myvalue int[]); |
Performs matrix summation. Can take as input a two-dimensional array that is treated as a matrix. |
| pivot_sum (label[], label, expr) | int[], bigint[], float[] | pivot_sum( array['A1','A2'], attr, value) | A pivot aggregation using sum to resolve duplicate entries. |
| mregr_coef(expr, array[]) | float[] | mregr_coef(y, array[1, x1, x2]) | The four mregr_*aggregates perform linear regressions using the ordinary-least-squares method. mregr_coefcalculates the regression coefficients. The size of the return array formregr_coef is the same as the size of the input array of independent variables, since the return array contains the coefficient for each independent variable. |
| mregr_r2 (expr, array[]) | float | mregr_r2(y, array[1, x1, x2]) | The four mregr_*aggregates perform linear regressions using the ordinary-least-squares method. mregr_r2calculates the r-squared error value for the regression. |
| mregr_pvalues(expr, array[]) | float[] | mregr_pvalues(y, array[1, x1, x2]) | The four mregr_*aggregates perform linear regressions using the ordinary-least-squares method. mregr_pvaluescalculates the p-values for the regression. |
| mregr_tstats(expr, array[]) | float[] | mregr_tstats(y, array[1, x1, x2]) | The four mregr_*aggregates perform linear regressions using the ordinary-least-squares method. mregr_tstatscalculates the t-statistics for the regression. |
| nb_classify(text[], bigint, bigint[], bigint[]) | text | nb_classify(classes, attr_count, class_count, class_total) | Classify rows using a Naive Bayes Classifier. This aggregate uses a baseline of training data to predict the classification of new rows and returns the class with the largest likelihood of appearing in the new rows. |
| nb_probabilities(text[], bigint, bigint[], bigint[]) | text | nb_probabilities(classes, attr_count, class_count, class_total) | Determine probability for each class using a Naive Bayes Classifier. This aggregate uses a baseline of training data to predict the classification of new rows and returns the probabilities that each class will appear in new rows. |
greenplum 数组操作的更多相关文章
- Javascript数组操作
使用JS也算有段时日,然对于数组的使用,总局限于很初级水平,且每每使用总要查下API,或者写个小Demo测试下才算放心,一来二去,浪费不少时间:思虑下,堪能如此继续之?当狠心深学下方是正道. 原文链接 ...
- JavaScript jQuery 中定义数组与操作及jquery数组操作
首先给大家介绍javascript jquery中定义数组与操作的相关知识,具体内容如下所示: 1.认识数组 数组就是某类数据的集合,数据类型可以是整型.字符串.甚至是对象Javascript不支持多 ...
- php数组操作集锦- 掌握了数组操作, 也就掌握了php
参考下面的文章, 是很好的: http://www.cnblogs.com/staven/p/5142515.html http://pcwanli.blog.163.com/blog/static/ ...
- JavaScript 数组操作
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...
- JavaScript中数组操作常用方法
JavaScript中数组操作常用方法 1.检测数组 1)检测对象是否为数组,使用instanceof 操作符 if(value instanceof Array) { //对数组执行某些操作 } 2 ...
- php 常用数组操作
php常用的数组操作函数,包括数组的赋值.拆分.合并.计算.添加.删除.查询.判断.排序等 array_combine 功能:用一个数组的值作为新数组的键名,另一个数组的值作为新数组的值 <?p ...
- 005-Scala数组操作实战详解
005-Scala数组操作实战详解 Worksheet的使用 交互式命令执行平台 记得每次要保存才会出相应的结果 数组的基本操作 数组的下标是从0开始和Tuple不同 缓冲数组ArrayBuffer( ...
- JavaScript中常见的数组操作函数及用法
JavaScript中常见的数组操作函数及用法 昨天写了个帖子,汇总了下常见的JavaScript中的字符串操作函数及用法.今天正好有时间,也去把JavaScript中常见的数组操作函数及用法总结一下 ...
- jQuery_03之事件、动画、类数组操作
一.事件: 1.模式触发事件: ①DOM:elem.onXXX();只能触发直接用onXXX绑定的事件处理函数:用addEventistener添加的事件监听无法模拟出发触发: ②jQuery:$ ...
随机推荐
- Session服务器之Memcached
材料:两台Tomcat(接Session复制一起做) 第一台Tomcat:IP为130 [root@localhost ~]# yum install libevent memcached -y ...
- 实验一  GIT 代码版本管理
实验一 GIT 代码版本管理 实验目的: 1)了解分布式分布式版本控制系统的核心机理: 2) 熟练掌握git的基本指令和分支管理指令: 实验内容: 1)安装git 2)初始配置git ,git ...
- redis 基础 Redis 数据类型
String(字符串) Hash(哈希) List(列表) Set(集合) zset(sorted set:有序集合)
- JDBC连接MySql例子
1.注册MySql连接驱动 2.设置连接MySql连接字符串.用户名和密码 3.获取数据库连接 代码如下: // 加载驱动 Class.forName("com.mysql.jdbc.Dri ...
- ip命令规范
从centos7以前我们一直使用ifconfig命令来执行网络相关的任务,比如检查和配置网卡信息,但是ifconfig已经不再被维护,并且在最近版本的Linux中被废除了!ifconfig命令已经被i ...
- UITextField的快速基本使用代码块
概述 UITextField在界面中显示可编辑文本区域的对象. 您可以使用文本字段来使用屏幕键盘从用户收集基于文本的输入.键盘可以配置许多不同类型的输入,如纯文本,电子邮件,数字等等.文本字段使用目标 ...
- char、pchar、string互相转换
1.string转换成pchar 可以使用pchar进行强制类型转换,也可以使用StrPCopy函数 var s:string; p,p1:PChar; begin s:='Hello Delphi' ...
- js 模拟鼠标拖动
window.addEventListener('message', function (event) { if (event.source != window) return; if (event. ...
- day1-3js代码执行特性
Js代码执行特性 js中变量声明都会提升到脚本的第一行(注意不是定义,只是声明) 函数变量声明也会提升到前面(是整个函数!)(变量最前,函数其后) 注:在执行js代码前,先把所有变量声明,函数提升至前 ...
- day22-Python运维开发基础(正则函数 / 异常处理)
1. 正则函数 # ### 正则表达式 => 正则函数 import re # search 通过正则匹配出第一个对象返回,通过group取出对象中的值 strvar = "5*7 9 ...