开发者社区 > 博文 > 【JUSTQL Reference】UDF介绍之实时数据处理
分享
  • 打开微信扫码分享

  • 点击前往QQ分享

  • 点击前往微博分享

  • 点击复制链接

【JUSTQL Reference】UDF介绍之实时数据处理

  • 京东城市JUST团队
  • 2021-01-26
  • IP归属:未知
  • 727浏览

JUST支持所有Flink1.10版本支持的UDF,具体内容点击此处查看同时,JUST新增UDF如下:

UDF

入参说明

返回值

说明

Timestamp st_utc2local(Timestamp value)

valueUTC时间

Local时间

UTC时间转成Local时间

Long st_timestamp2MS(Timestamp value)

valueTimestamp

13位毫秒值

Timestamp转成毫秒值

String st_dateFormat(String value, String inputPattern[, String outputPattern])

value:字符串类型的日期

inputPattern:输入的时间格式

outputPattern:输出的时间格式(可选,默认yyyy-MM-dd)

指定格式的时间

将字符串类型的日期格式化成指定格式

String st_dateTimeFormat(String value, String inputPattern[, String outputPattern])

value:字符串类型的时间

inputPattern:输入的时间格式

outputPattern:输出的时间格式(可选,默认yyyy-MM-dd HH:mm:ss)

指定格式的时间

将字符串类型的时间格式化成指定格式

String st_dateTime2Timestamp(String value, String inputPattern)

value:字符串类型的时间

inputPattern:输入的时间格式

Timestamp

将字符串类型的时间转成Timestamp类型的时间

Point st_makePoint(Double lng, Double lat)

lng:经度,lat:纬度

Point对象

将经纬度转成Point

LineString st_makeLine(Row[] pointRows)

pointRowsPoint集合, Row<经度,纬度>格式的数组

LineString对象

Point集合转成LineString

Polygon st_makePolygon(LineString shell)

shell:线

Polygon对象

LineString转成Polygon

Geometry st_makeBBOX(Double lowerX, Double lowerY, Double upperX, Double upperY)

lowerX:左下角的空间点经度,lowerY:左下角的空间点纬度,upperX:右上角的空间点经度,upperY:右上角的空间点纬度

Geometry对象

根据点坐标生成MBR

Point st_pointFromText(String wkt)

wktWKT字符串

Point对象

WKT转成Point

LineString st_lineFromText(String wkt)

wktWKT字符串

LineString对象

WKT转成LineString

Polygon st_polygonFromText(String wkt)

wktWKT字符串

Polygon对象

WKT转成Polygon

Geometry st_geomFromText(String wkt)

wktWKT字符串

Geometry对象

WKT转成Geometry

Geometry st_geomFromWKT(String wkt)

wktWKT字符串

Geometry对象

WKT转成Geometry

Geometry st_geomFromGeoHash(String hash, int prec)

hashGeoHash字符串,prec:位数

Geometry对象

GeoHash转成Geometry

Point st_pointFromGeoHash(String hash, int prec)

hashGeoHash字符串,prec:位数

Point对象

GeoHash转成Point

String st_asText(Geometry geom)

geomGeometry对象

WKT字符串

Geometry转成WKT

String st_geoHash(Geometry geom, int prec)

geomGeometry对象 prec:位数

GeoHash字符串

Geometry转成GeoHash

String st_asGeoJSON(Geometry geom)

geomGeometry对象

GeoJSON字符串

Geometry转成GeoJSON

Double st_x(Point point)

pointPoint对象

经度

Point中获取经度

Double st_y(Point point)

pointPoint对象

纬度

Point中获取纬度

Point st_castToPoint(Geometry geom)

geomGeometry对象

Point对象

Geometry转成Point

LineString st_castToLineString(Geometry geom)

geomGeometry对象

LineString对象

Geometry转成LineString

Polygon st_castToPolygon(Geometry geom)

geomGeometry对象

Polygon对象

Geometry转成Polygon

其他空间类型的UDF,具体内容击此处查看

注:本手册提供实时join维表&窗口统计示例,见附录4.4

共0条评论