天天看點

Hive中擴充GIS函數

參考部落格:https://www.jianshu.com/p/bb956bb4f996

應用場景

目前,Hive表中存在需要把經緯度轉化為距離,和一些其他相關的計算函數,但是在hive中并沒有內建這些函數。當然我們可以自定義UDF函數,但是現在提供一個更加簡單的方法,通過源碼編譯的方式,內建GIS函數。

環境

<profile>
      <id>hadoop-2.7</id>
      <properties>
        <hadoop.version>2.7.3</hadoop.version>
      </properties>
</profile>

 <profile>
      <id>hive-1.2</id>
      <properties>
        <hive.version>1.2.1</hive.version>
      </properties>
 </profile>

<java.source.version>1.8</java.source.version>
<java.target.version>1.8</java.target.version>
<hadoop.version>2.7.3</hadoop.version>
<hive.version>1.2.1</hive.version>
           

下載下傳源碼:

源碼位址

在github上下載下傳源碼在本地idea進行編譯,修改最外層的pom.xml,修改hadoop、hive、java版本為生産環境中版本

  • idea中添加項目
    Hive中擴充GIS函數
  • 打包
    Hive中擴充GIS函數
    打包後會出現如下兩個jar包:
spatial-sdk-json-2.1.1-SNAPSHOT.jar
spatial-sdk-hive-2.1.1-SNAPSHOT.jar
           

然後下載下傳最新的esri-geometry-java中的esri-geometry-api-2.2.1.jar,上傳三個jar到linux系統(jar權限設定成最高),在hive的shell控制台輸入添加jar和建立函數語句。

建立函數

如果jar包在本地則建立臨時函數,隻在目前session有效,我們可以把jar包上傳到HDFS上建立永久函數。

add jar  /iDatalight/jars/esri-geometry-api-2.2.1.jar;
add jar  /iDatalight/jars/spatial-sdk-json-2.1.0.jar;
add jar  /iDatalight/jars/spatial-sdk-hive-2.1.0.jar;
           

自定義函數使用可以參考官方文檔UDF文檔,建立自定義函數可以參考spatial-framework-for-hadoop項目的hive下function-ddl.sql,但建立永久函數需要去掉temporary。

CREATE FUNCTION STPoint as 'com.esri.hadoop.hive.ST_Point' using jar 'hdfs:///iDatalight/jars/esri-geometry-api-2.2.2.jar',jar 'hdfs:///iDatalight/jars/spatial-sdk-hive-2.1.1.jar',jar 'hdfs:///iDatalight/jars/spatial-sdk-json-2.1.1.jar';

create function ST_AsBinary as 'com.esri.hadoop.hive.ST_AsBinary' using jar 'hdfs:///iDatalight/jars/esri-geometry-api-2.2.2.jar',jar 'hdfs:///iDatalight/jars/spatial-sdk-hive-2.1.1.jar',jar 'hdfs:///iDatalight/jars/spatial-sdk-json-2.1.1.jar';
create function ST_AsGeoJSON as 'com.esri.hadoop.hive.ST_AsGeoJson' using jar 'hdfs:///iDatalight/jars/esri-geometry-api-2.2.2.jar',jar 'hdfs:///iDatalight/jars/spatial-sdk-hive-2.1.1.jar',jar 'hdfs:///iDatalight/jars/spatial-sdk-json-2.1.1.jar';
create function ST_AsJSON as 'com.esri.hadoop.hive.ST_AsJson' using jar 'hdfs:///iDatalight/jars/esri-geometry-api-2.2.2.jar',jar 'hdfs:///iDatalight/jars/spatial-sdk-hive-2.1.1.jar',jar 'hdfs:///iDatalight/jars/spatial-sdk-json-2.1.1.jar';
create function ST_AsShape as 'com.esri.hadoop.hive.ST_AsShape' using jar 'hdfs:///iDatalight/jars/esri-geometry-api-2.2.2.jar',jar 'hdfs:///iDatalight/jars/spatial-sdk-hive-2.1.1.jar',jar 'hdfs:///iDatalight/jars/spatial-sdk-json-2.1.1.jar';
create function ST_AsText as 'com.esri.hadoop.hive.ST_AsText' using jar 'hdfs:///iDatalight/jars/esri-geometry-api-2.2.2.jar',jar 'hdfs:///iDatalight/jars/spatial-sdk-hive-2.1.1.jar',jar 'hdfs:///iDatalight/jars/spatial-sdk-json-2.1.1.jar';
create function ST_GeomFromJSON as 'com.esri.hadoop.hive.ST_GeomFromJson' using jar 'hdfs:///iDatalight/jars/esri-geometry-api-2.2.2.jar',jar 'hdfs:///iDatalight/jars/spatial-sdk-hive-2.1.1.jar',jar 'hdfs:///iDatalight/jars/spatial-sdk-json-2.1.1.jar';
create function ST_GeomFromGeoJSON as 'com.esri.hadoop.hive.ST_GeomFromGeoJson' using jar 'hdfs:///iDatalight/jars/esri-geometry-api-2.2.2.jar',jar 'hdfs:///iDatalight/jars/spatial-sdk-hive-2.1.1.jar',jar 'hdfs:///iDatalight/jars/spatial-sdk-json-2.1.1.jar';
create function ST_GeomFromShape as 'com.esri.hadoop.hive.ST_GeomFromShape' using jar 'hdfs:///iDatalight/jars/esri-geometry-api-2.2.2.jar',jar 'hdfs:///iDatalight/jars/spatial-sdk-hive-2.1.1.jar',jar 'hdfs:///iDatalight/jars/spatial-sdk-json-2.1.1.jar';
create function ST_GeomFromText as 'com.esri.hadoop.hive.ST_GeomFromText' using jar 'hdfs:///iDatalight/jars/esri-geometry-api-2.2.2.jar',jar 'hdfs:///iDatalight/jars/spatial-sdk-hive-2.1.1.jar',jar 'hdfs:///iDatalight/jars/spatial-sdk-json-2.1.1.jar';
create function ST_GeomFromWKB as 'com.esri.hadoop.hive.ST_GeomFromWKB' using jar 'hdfs:///iDatalight/jars/esri-geometry-api-2.2.2.jar',jar 'hdfs:///iDatalight/jars/spatial-sdk-hive-2.1.1.jar',jar 'hdfs:///iDatalight/jars/spatial-sdk-json-2.1.1.jar';
create function ST_PointFromWKB as 'com.esri.hadoop.hive.ST_PointFromWKB' using jar 'hdfs:///iDatalight/jars/esri-geometry-api-2.2.2.jar',jar 'hdfs:///iDatalight/jars/spatial-sdk-hive-2.1.1.jar',jar 'hdfs:///iDatalight/jars/spatial-sdk-json-2.1.1.jar';
create function ST_LineFromWKB as 'com.esri.hadoop.hive.ST_LineFromWKB' using jar 'hdfs:///iDatalight/jars/esri-geometry-api-2.2.2.jar',jar 'hdfs:///iDatalight/jars/spatial-sdk-hive-2.1.1.jar',jar 'hdfs:///iDatalight/jars/spatial-sdk-json-2.1.1.jar';
create function ST_PolyFromWKB as 'com.esri.hadoop.hive.ST_PolyFromWKB' using jar 'hdfs:///iDatalight/jars/esri-geometry-api-2.2.2.jar',jar 'hdfs:///iDatalight/jars/spatial-sdk-hive-2.1.1.jar',jar 'hdfs:///iDatalight/jars/spatial-sdk-json-2.1.1.jar';
create function ST_MPointFromWKB as 'com.esri.hadoop.hive.ST_MPointFromWKB' using jar 'hdfs:///iDatalight/jars/esri-geometry-api-2.2.2.jar',jar 'hdfs:///iDatalight/jars/spatial-sdk-hive-2.1.1.jar',jar 'hdfs:///iDatalight/jars/spatial-sdk-json-2.1.1.jar';
create function ST_MLineFromWKB as 'com.esri.hadoop.hive.ST_MLineFromWKB' using jar 'hdfs:///iDatalight/jars/esri-geometry-api-2.2.2.jar',jar 'hdfs:///iDatalight/jars/spatial-sdk-hive-2.1.1.jar',jar 'hdfs:///iDatalight/jars/spatial-sdk-json-2.1.1.jar';
create function ST_MPolyFromWKB as 'com.esri.hadoop.hive.ST_MPolyFromWKB' using jar 'hdfs:///iDatalight/jars/esri-geometry-api-2.2.2.jar',jar 'hdfs:///iDatalight/jars/spatial-sdk-hive-2.1.1.jar',jar 'hdfs:///iDatalight/jars/spatial-sdk-json-2.1.1.jar';
create function ST_GeomCollection as 'com.esri.hadoop.hive.ST_GeomCollection' using jar 'hdfs:///iDatalight/jars/esri-geometry-api-2.2.2.jar',jar 'hdfs:///iDatalight/jars/spatial-sdk-hive-2.1.1.jar',jar 'hdfs:///iDatalight/jars/spatial-sdk-json-2.1.1.jar';


create function ST_GeometryType as 'com.esri.hadoop.hive.ST_GeometryType' using jar 'hdfs:///iDatalight/jars/esri-geometry-api-2.2.2.jar',jar 'hdfs:///iDatalight/jars/spatial-sdk-hive-2.1.1.jar',jar 'hdfs:///iDatalight/jars/spatial-sdk-json-2.1.1.jar';
create function ST_LineString as 'com.esri.hadoop.hive.ST_LineString' using jar 'hdfs:///iDatalight/jars/esri-geometry-api-2.2.2.jar',jar 'hdfs:///iDatalight/jars/spatial-sdk-hive-2.1.1.jar',jar 'hdfs:///iDatalight/jars/spatial-sdk-json-2.1.1.jar';
create function ST_Polygon as 'com.esri.hadoop.hive.ST_Polygon' using jar 'hdfs:///iDatalight/jars/esri-geometry-api-2.2.2.jar',jar 'hdfs:///iDatalight/jars/spatial-sdk-hive-2.1.1.jar',jar 'hdfs:///iDatalight/jars/spatial-sdk-json-2.1.1.jar';
create function ST_MultiPoint as 'com.esri.hadoop.hive.ST_MultiPoint' using jar 'hdfs:///iDatalight/jars/esri-geometry-api-2.2.2.jar',jar 'hdfs:///iDatalight/jars/spatial-sdk-hive-2.1.1.jar',jar 'hdfs:///iDatalight/jars/spatial-sdk-json-2.1.1.jar';
create function ST_MultiLineString as 'com.esri.hadoop.hive.ST_MultiLineString' using jar 'hdfs:///iDatalight/jars/esri-geometry-api-2.2.2.jar',jar 'hdfs:///iDatalight/jars/spatial-sdk-hive-2.1.1.jar',jar 'hdfs:///iDatalight/jars/spatial-sdk-json-2.1.1.jar';
create function ST_MultiPolygon as 'com.esri.hadoop.hive.ST_MultiPolygon' using jar 'hdfs:///iDatalight/jars/esri-geometry-api-2.2.2.jar',jar 'hdfs:///iDatalight/jars/spatial-sdk-hive-2.1.1.jar',jar 'hdfs:///iDatalight/jars/spatial-sdk-json-2.1.1.jar';
create function ST_SetSRID as 'com.esri.hadoop.hive.ST_SetSRID' using jar 'hdfs:///iDatalight/jars/esri-geometry-api-2.2.2.jar',jar 'hdfs:///iDatalight/jars/spatial-sdk-hive-2.1.1.jar',jar 'hdfs:///iDatalight/jars/spatial-sdk-json-2.1.1.jar';
create function ST_SRID as 'com.esri.hadoop.hive.ST_SRID' using jar 'hdfs:///iDatalight/jars/esri-geometry-api-2.2.2.jar',jar 'hdfs:///iDatalight/jars/spatial-sdk-hive-2.1.1.jar',jar 'hdfs:///iDatalight/jars/spatial-sdk-json-2.1.1.jar';
create function ST_IsEmpty as 'com.esri.hadoop.hive.ST_IsEmpty' using jar 'hdfs:///iDatalight/jars/esri-geometry-api-2.2.2.jar',jar 'hdfs:///iDatalight/jars/spatial-sdk-hive-2.1.1.jar',jar 'hdfs:///iDatalight/jars/spatial-sdk-json-2.1.1.jar';
create function ST_IsSimple as 'com.esri.hadoop.hive.ST_IsSimple' using jar 'hdfs:///iDatalight/jars/esri-geometry-api-2.2.2.jar',jar 'hdfs:///iDatalight/jars/spatial-sdk-hive-2.1.1.jar',jar 'hdfs:///iDatalight/jars/spatial-sdk-json-2.1.1.jar';
create function ST_Dimension as 'com.esri.hadoop.hive.ST_Dimension' using jar 'hdfs:///iDatalight/jars/esri-geometry-api-2.2.2.jar',jar 'hdfs:///iDatalight/jars/spatial-sdk-hive-2.1.1.jar',jar 'hdfs:///iDatalight/jars/spatial-sdk-json-2.1.1.jar';
create function ST_X as 'com.esri.hadoop.hive.ST_X' using jar 'hdfs:///iDatalight/jars/esri-geometry-api-2.2.2.jar',jar 'hdfs:///iDatalight/jars/spatial-sdk-hive-2.1.1.jar',jar 'hdfs:///iDatalight/jars/spatial-sdk-json-2.1.1.jar';
create function ST_Y as 'com.esri.hadoop.hive.ST_Y' using jar 'hdfs:///iDatalight/jars/esri-geometry-api-2.2.2.jar',jar 'hdfs:///iDatalight/jars/spatial-sdk-hive-2.1.1.jar',jar 'hdfs:///iDatalight/jars/spatial-sdk-json-2.1.1.jar';
create function ST_MinX as 'com.esri.hadoop.hive.ST_MinX' using jar 'hdfs:///iDatalight/jars/esri-geometry-api-2.2.2.jar',jar 'hdfs:///iDatalight/jars/spatial-sdk-hive-2.1.1.jar',jar 'hdfs:///iDatalight/jars/spatial-sdk-json-2.1.1.jar';
create function ST_MaxX as 'com.esri.hadoop.hive.ST_MaxX' using jar 'hdfs:///iDatalight/jars/esri-geometry-api-2.2.2.jar',jar 'hdfs:///iDatalight/jars/spatial-sdk-hive-2.1.1.jar',jar 'hdfs:///iDatalight/jars/spatial-sdk-json-2.1.1.jar';
create function ST_MinY as 'com.esri.hadoop.hive.ST_MinY' using jar 'hdfs:///iDatalight/jars/esri-geometry-api-2.2.2.jar',jar 'hdfs:///iDatalight/jars/spatial-sdk-hive-2.1.1.jar',jar 'hdfs:///iDatalight/jars/spatial-sdk-json-2.1.1.jar';
create function ST_MaxY as 'com.esri.hadoop.hive.ST_MaxY' using jar 'hdfs:///iDatalight/jars/esri-geometry-api-2.2.2.jar',jar 'hdfs:///iDatalight/jars/spatial-sdk-hive-2.1.1.jar',jar 'hdfs:///iDatalight/jars/spatial-sdk-json-2.1.1.jar';
create function ST_IsClosed as 'com.esri.hadoop.hive.ST_IsClosed' using jar 'hdfs:///iDatalight/jars/esri-geometry-api-2.2.2.jar',jar 'hdfs:///iDatalight/jars/spatial-sdk-hive-2.1.1.jar',jar 'hdfs:///iDatalight/jars/spatial-sdk-json-2.1.1.jar';
create function ST_IsRing as 'com.esri.hadoop.hive.ST_IsRing' using jar 'hdfs:///iDatalight/jars/esri-geometry-api-2.2.2.jar',jar 'hdfs:///iDatalight/jars/spatial-sdk-hive-2.1.1.jar',jar 'hdfs:///iDatalight/jars/spatial-sdk-json-2.1.1.jar';
create function ST_Length as 'com.esri.hadoop.hive.ST_Length' using jar 'hdfs:///iDatalight/jars/esri-geometry-api-2.2.2.jar',jar 'hdfs:///iDatalight/jars/spatial-sdk-hive-2.1.1.jar',jar 'hdfs:///iDatalight/jars/spatial-sdk-json-2.1.1.jar';
create function ST_GeodesicLengthWGS84 as 'com.esri.hadoop.hive.ST_GeodesicLengthWGS84' using jar 'hdfs:///iDatalight/jars/esri-geometry-api-2.2.2.jar',jar 'hdfs:///iDatalight/jars/spatial-sdk-hive-2.1.1.jar',jar 'hdfs:///iDatalight/jars/spatial-sdk-json-2.1.1.jar';
create function ST_Area as 'com.esri.hadoop.hive.ST_Area' using jar 'hdfs:///iDatalight/jars/esri-geometry-api-2.2.2.jar',jar 'hdfs:///iDatalight/jars/spatial-sdk-hive-2.1.1.jar',jar 'hdfs:///iDatalight/jars/spatial-sdk-json-2.1.1.jar';
create function ST_Is3D as 'com.esri.hadoop.hive.ST_Is3D' using jar 'hdfs:///iDatalight/jars/esri-geometry-api-2.2.2.jar',jar 'hdfs:///iDatalight/jars/spatial-sdk-hive-2.1.1.jar',jar 'hdfs:///iDatalight/jars/spatial-sdk-json-2.1.1.jar';
create function ST_Z as 'com.esri.hadoop.hive.ST_Z' using jar 'hdfs:///iDatalight/jars/esri-geometry-api-2.2.2.jar',jar 'hdfs:///iDatalight/jars/spatial-sdk-hive-2.1.1.jar',jar 'hdfs:///iDatalight/jars/spatial-sdk-json-2.1.1.jar';
create function ST_MinZ as 'com.esri.hadoop.hive.ST_MinZ' using jar 'hdfs:///iDatalight/jars/esri-geometry-api-2.2.2.jar',jar 'hdfs:///iDatalight/jars/spatial-sdk-hive-2.1.1.jar',jar 'hdfs:///iDatalight/jars/spatial-sdk-json-2.1.1.jar';
create function ST_MaxZ as 'com.esri.hadoop.hive.ST_MaxZ' using jar 'hdfs:///iDatalight/jars/esri-geometry-api-2.2.2.jar',jar 'hdfs:///iDatalight/jars/spatial-sdk-hive-2.1.1.jar',jar 'hdfs:///iDatalight/jars/spatial-sdk-json-2.1.1.jar';
create function ST_IsMeasured as 'com.esri.hadoop.hive.ST_IsMeasured' using jar 'hdfs:///iDatalight/jars/esri-geometry-api-2.2.2.jar',jar 'hdfs:///iDatalight/jars/spatial-sdk-hive-2.1.1.jar',jar 'hdfs:///iDatalight/jars/spatial-sdk-json-2.1.1.jar';
create function ST_M as 'com.esri.hadoop.hive.ST_M' using jar 'hdfs:///iDatalight/jars/esri-geometry-api-2.2.2.jar',jar 'hdfs:///iDatalight/jars/spatial-sdk-hive-2.1.1.jar',jar 'hdfs:///iDatalight/jars/spatial-sdk-json-2.1.1.jar';
create function ST_MinM as 'com.esri.hadoop.hive.ST_MinM' using jar 'hdfs:///iDatalight/jars/esri-geometry-api-2.2.2.jar',jar 'hdfs:///iDatalight/jars/spatial-sdk-hive-2.1.1.jar',jar 'hdfs:///iDatalight/jars/spatial-sdk-json-2.1.1.jar';
create function ST_MaxM as 'com.esri.hadoop.hive.ST_MaxM' using jar 'hdfs:///iDatalight/jars/esri-geometry-api-2.2.2.jar',jar 'hdfs:///iDatalight/jars/spatial-sdk-hive-2.1.1.jar',jar 'hdfs:///iDatalight/jars/spatial-sdk-json-2.1.1.jar';
create function ST_CoordDim as 'com.esri.hadoop.hive.ST_CoordDim' using jar 'hdfs:///iDatalight/jars/esri-geometry-api-2.2.2.jar',jar 'hdfs:///iDatalight/jars/spatial-sdk-hive-2.1.1.jar',jar 'hdfs:///iDatalight/jars/spatial-sdk-json-2.1.1.jar';
create function ST_NumPoints as 'com.esri.hadoop.hive.ST_NumPoints' using jar 'hdfs:///iDatalight/jars/esri-geometry-api-2.2.2.jar',jar 'hdfs:///iDatalight/jars/spatial-sdk-hive-2.1.1.jar',jar 'hdfs:///iDatalight/jars/spatial-sdk-json-2.1.1.jar';
create function ST_PointN as 'com.esri.hadoop.hive.ST_PointN' using jar 'hdfs:///iDatalight/jars/esri-geometry-api-2.2.2.jar',jar 'hdfs:///iDatalight/jars/spatial-sdk-hive-2.1.1.jar',jar 'hdfs:///iDatalight/jars/spatial-sdk-json-2.1.1.jar';
create function ST_StartPoint as 'com.esri.hadoop.hive.ST_StartPoint' using jar 'hdfs:///iDatalight/jars/esri-geometry-api-2.2.2.jar',jar 'hdfs:///iDatalight/jars/spatial-sdk-hive-2.1.1.jar',jar 'hdfs:///iDatalight/jars/spatial-sdk-json-2.1.1.jar';
create function ST_EndPoint as 'com.esri.hadoop.hive.ST_EndPoint' using jar 'hdfs:///iDatalight/jars/esri-geometry-api-2.2.2.jar',jar 'hdfs:///iDatalight/jars/spatial-sdk-hive-2.1.1.jar',jar 'hdfs:///iDatalight/jars/spatial-sdk-json-2.1.1.jar';
create function ST_ExteriorRing as 'com.esri.hadoop.hive.ST_ExteriorRing' using jar 'hdfs:///iDatalight/jars/esri-geometry-api-2.2.2.jar',jar 'hdfs:///iDatalight/jars/spatial-sdk-hive-2.1.1.jar',jar 'hdfs:///iDatalight/jars/spatial-sdk-json-2.1.1.jar';
create function ST_NumInteriorRing as 'com.esri.hadoop.hive.ST_NumInteriorRing' using jar 'hdfs:///iDatalight/jars/esri-geometry-api-2.2.2.jar',jar 'hdfs:///iDatalight/jars/spatial-sdk-hive-2.1.1.jar',jar 'hdfs:///iDatalight/jars/spatial-sdk-json-2.1.1.jar';
create function ST_InteriorRingN as 'com.esri.hadoop.hive.ST_InteriorRingN' using jar 'hdfs:///iDatalight/jars/esri-geometry-api-2.2.2.jar',jar 'hdfs:///iDatalight/jars/spatial-sdk-hive-2.1.1.jar',jar 'hdfs:///iDatalight/jars/spatial-sdk-json-2.1.1.jar';
create function ST_NumGeometries as 'com.esri.hadoop.hive.ST_NumGeometries' using jar 'hdfs:///iDatalight/jars/esri-geometry-api-2.2.2.jar',jar 'hdfs:///iDatalight/jars/spatial-sdk-hive-2.1.1.jar',jar 'hdfs:///iDatalight/jars/spatial-sdk-json-2.1.1.jar';
create function ST_GeometryN as 'com.esri.hadoop.hive.ST_GeometryN' using jar 'hdfs:///iDatalight/jars/esri-geometry-api-2.2.2.jar',jar 'hdfs:///iDatalight/jars/spatial-sdk-hive-2.1.1.jar',jar 'hdfs:///iDatalight/jars/spatial-sdk-json-2.1.1.jar';
create function ST_Centroid as 'com.esri.hadoop.hive.ST_Centroid' using jar 'hdfs:///iDatalight/jars/esri-geometry-api-2.2.2.jar',jar 'hdfs:///iDatalight/jars/spatial-sdk-hive-2.1.1.jar',jar 'hdfs:///iDatalight/jars/spatial-sdk-json-2.1.1.jar';

create  function ST_Contains as 'com.esri.hadoop.hive.ST_Contains' using jar 'hdfs:///iDatalight/jars/esri-geometry-api-2.2.2.jar',jar 'hdfs:///iDatalight/jars/spatial-sdk-hive-2.1.1.jar',jar 'hdfs:///iDatalight/jars/spatial-sdk-json-2.1.1.jar';
create  function ST_Crosses as 'com.esri.hadoop.hive.ST_Crosses' using jar 'hdfs:///iDatalight/jars/esri-geometry-api-2.2.2.jar',jar 'hdfs:///iDatalight/jars/spatial-sdk-hive-2.1.1.jar',jar 'hdfs:///iDatalight/jars/spatial-sdk-json-2.1.1.jar';
create  function ST_Disjoint as 'com.esri.hadoop.hive.ST_Disjoint' using jar 'hdfs:///iDatalight/jars/esri-geometry-api-2.2.2.jar',jar 'hdfs:///iDatalight/jars/spatial-sdk-hive-2.1.1.jar',jar 'hdfs:///iDatalight/jars/spatial-sdk-json-2.1.1.jar';
create  function ST_EnvIntersects as 'com.esri.hadoop.hive.ST_EnvIntersects' using jar 'hdfs:///iDatalight/jars/esri-geometry-api-2.2.2.jar',jar 'hdfs:///iDatalight/jars/spatial-sdk-hive-2.1.1.jar',jar 'hdfs:///iDatalight/jars/spatial-sdk-json-2.1.1.jar';
create  function ST_Envelope as 'com.esri.hadoop.hive.ST_Envelope' using jar 'hdfs:///iDatalight/jars/esri-geometry-api-2.2.2.jar',jar 'hdfs:///iDatalight/jars/spatial-sdk-hive-2.1.1.jar',jar 'hdfs:///iDatalight/jars/spatial-sdk-json-2.1.1.jar';
create  function ST_Equals as 'com.esri.hadoop.hive.ST_Equals' using jar 'hdfs:///iDatalight/jars/esri-geometry-api-2.2.2.jar',jar 'hdfs:///iDatalight/jars/spatial-sdk-hive-2.1.1.jar',jar 'hdfs:///iDatalight/jars/spatial-sdk-json-2.1.1.jar';
create  function ST_Overlaps as 'com.esri.hadoop.hive.ST_Overlaps' using jar 'hdfs:///iDatalight/jars/esri-geometry-api-2.2.2.jar',jar 'hdfs:///iDatalight/jars/spatial-sdk-hive-2.1.1.jar',jar 'hdfs:///iDatalight/jars/spatial-sdk-json-2.1.1.jar';
create  function ST_Intersects as 'com.esri.hadoop.hive.ST_Intersects' using jar 'hdfs:///iDatalight/jars/esri-geometry-api-2.2.2.jar',jar 'hdfs:///iDatalight/jars/spatial-sdk-hive-2.1.1.jar',jar 'hdfs:///iDatalight/jars/spatial-sdk-json-2.1.1.jar';
create  function ST_Relate as 'com.esri.hadoop.hive.ST_Relate' using jar 'hdfs:///iDatalight/jars/esri-geometry-api-2.2.2.jar',jar 'hdfs:///iDatalight/jars/spatial-sdk-hive-2.1.1.jar',jar 'hdfs:///iDatalight/jars/spatial-sdk-json-2.1.1.jar';
create  function ST_Touches as 'com.esri.hadoop.hive.ST_Touches' using jar 'hdfs:///iDatalight/jars/esri-geometry-api-2.2.2.jar',jar 'hdfs:///iDatalight/jars/spatial-sdk-hive-2.1.1.jar',jar 'hdfs:///iDatalight/jars/spatial-sdk-json-2.1.1.jar';
create  function ST_Within as 'com.esri.hadoop.hive.ST_Within' using jar 'hdfs:///iDatalight/jars/esri-geometry-api-2.2.2.jar',jar 'hdfs:///iDatalight/jars/spatial-sdk-hive-2.1.1.jar',jar 'hdfs:///iDatalight/jars/spatial-sdk-json-2.1.1.jar';

create  function ST_Distance as 'com.esri.hadoop.hive.ST_Distance' using jar 'hdfs:///iDatalight/jars/esri-geometry-api-2.2.2.jar',jar 'hdfs:///iDatalight/jars/spatial-sdk-hive-2.1.1.jar',jar 'hdfs:///iDatalight/jars/spatial-sdk-json-2.1.1.jar';
create  function ST_Boundary as 'com.esri.hadoop.hive.ST_Boundary' using jar 'hdfs:///iDatalight/jars/esri-geometry-api-2.2.2.jar',jar 'hdfs:///iDatalight/jars/spatial-sdk-hive-2.1.1.jar',jar 'hdfs:///iDatalight/jars/spatial-sdk-json-2.1.1.jar';
create  function ST_Buffer as 'com.esri.hadoop.hive.ST_Buffer' using jar 'hdfs:///iDatalight/jars/esri-geometry-api-2.2.2.jar',jar 'hdfs:///iDatalight/jars/spatial-sdk-hive-2.1.1.jar',jar 'hdfs:///iDatalight/jars/spatial-sdk-json-2.1.1.jar';
create  function ST_ConvexHull as 'com.esri.hadoop.hive.ST_ConvexHull' using jar 'hdfs:///iDatalight/jars/esri-geometry-api-2.2.2.jar',jar 'hdfs:///iDatalight/jars/spatial-sdk-hive-2.1.1.jar',jar 'hdfs:///iDatalight/jars/spatial-sdk-json-2.1.1.jar';
create  function ST_Intersection as 'com.esri.hadoop.hive.ST_Intersection' using jar 'hdfs:///iDatalight/jars/esri-geometry-api-2.2.2.jar',jar 'hdfs:///iDatalight/jars/spatial-sdk-hive-2.1.1.jar',jar 'hdfs:///iDatalight/jars/spatial-sdk-json-2.1.1.jar';
create  function ST_Union as 'com.esri.hadoop.hive.ST_Union' using jar 'hdfs:///iDatalight/jars/esri-geometry-api-2.2.2.jar',jar 'hdfs:///iDatalight/jars/spatial-sdk-hive-2.1.1.jar',jar 'hdfs:///iDatalight/jars/spatial-sdk-json-2.1.1.jar';
create  function ST_Difference as 'com.esri.hadoop.hive.ST_Difference' using jar 'hdfs:///iDatalight/jars/esri-geometry-api-2.2.2.jar',jar 'hdfs:///iDatalight/jars/spatial-sdk-hive-2.1.1.jar',jar 'hdfs:///iDatalight/jars/spatial-sdk-json-2.1.1.jar';
create  function ST_SymmetricDiff as 'com.esri.hadoop.hive.ST_SymmetricDiff' using jar 'hdfs:///iDatalight/jars/esri-geometry-api-2.2.2.jar',jar 'hdfs:///iDatalight/jars/spatial-sdk-hive-2.1.1.jar',jar 'hdfs:///iDatalight/jars/spatial-sdk-json-2.1.1.jar';
create  function ST_SymDifference as 'com.esri.hadoop.hive.ST_SymmetricDiff' using jar 'hdfs:///iDatalight/jars/esri-geometry-api-2.2.2.jar',jar 'hdfs:///iDatalight/jars/spatial-sdk-hive-2.1.1.jar',jar 'hdfs:///iDatalight/jars/spatial-sdk-json-2.1.1.jar';

create  function ST_Aggr_ConvexHull as 'com.esri.hadoop.hive.ST_Aggr_ConvexHull' using jar 'hdfs:///iDatalight/jars/esri-geometry-api-2.2.2.jar',jar 'hdfs:///iDatalight/jars/spatial-sdk-hive-2.1.1.jar',jar 'hdfs:///iDatalight/jars/spatial-sdk-json-2.1.1.jar';
create  function ST_Aggr_Intersection as 'com.esri.hadoop.hive.ST_Aggr_Intersection' using jar 'hdfs:///iDatalight/jars/esri-geometry-api-2.2.2.jar',jar 'hdfs:///iDatalight/jars/spatial-sdk-hive-2.1.1.jar',jar 'hdfs:///iDatalight/jars/spatial-sdk-json-2.1.1.jar';
create  function ST_Aggr_Union as 'com.esri.hadoop.hive.ST_Aggr_Union' using jar 'hdfs:///iDatalight/jars/esri-geometry-api-2.2.2.jar',jar 'hdfs:///iDatalight/jars/spatial-sdk-hive-2.1.1.jar',jar 'hdfs:///iDatalight/jars/spatial-sdk-json-2.1.1.jar';

create  function ST_Bin as 'com.esri.hadoop.hive.ST_Bin' using jar 'hdfs:///iDatalight/jars/esri-geometry-api-2.2.2.jar',jar 'hdfs:///iDatalight/jars/spatial-sdk-hive-2.1.1.jar',jar 'hdfs:///iDatalight/jars/spatial-sdk-json-2.1.1.jar';
create  function ST_BinEnvelope as 'com.esri.hadoop.hive.ST_BinEnvelope' using jar 'hdfs:///iDatalight/jars/esri-geometry-api-2.2.2.jar',jar 'hdfs:///iDatalight/jars/spatial-sdk-hive-2.1.1.jar',jar 'hdfs:///iDatalight/jars/spatial-sdk-json-2.1.1.jar';
           

繼續閱讀