Esri / spatial-framework-for-hadoop

The Spatial Framework for Hadoop allows developers and data scientists to use the Hadoop data processing system for spatial data analysis.
Apache License 2.0
363 stars 160 forks source link

Problem in executing hive query #133

Closed pidubey closed 3 years ago

pidubey commented 6 years ago

I have faced problem creating table counties CREATE TABLE counties (Area string, Perimeter string, State string, County string, Name string, BoundaryShape binary)

ROW FORMAT SERDE 'com.esri.hadoop.hive.serde.EsriJsonSerDe' STORED AS INPUTFORMAT 'com.esri.json.hadoop.EnclosedEsriJsonInputFormat' OUTPUTFORMAT 'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat';

Error: FAILED: SemanticException Cannot find class 'com.esri.json.hadoop.EnclosedEsriJsonInputFormat'

I have tried some solutions from online help but did't get succeded.

kindly let me know the issue.

Thanks with regards

randallwhitman commented 6 years ago

Did you add jar? What version of Hive? What version of Spatial Framework for Hadoop? Built from source, or downloaded JAR files from GitHub, or from Maven Central?

pidubey commented 6 years ago

Yes I have added jar

Ubuntu OS 16.04 Hadoop 2.6.0 Hive 2.3.0

I have created a directory in hdfs, copied all the jars in the folder and then added jars using Hive. The jars are also in lib and folder of Hive and bash file is having class path of lib folder of Hive. The hadoop user and group is having rights on both the folder but still I am getting the error.

With regards Piyush

On Nov 3, 2017 8:59 PM, "Randall Whitman" notifications@github.com wrote:

Did you add jar? What version of Hive?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/Esri/spatial-framework-for-hadoop/issues/133#issuecomment-341737137, or mute the thread https://github.com/notifications/unsubscribe-auth/AfzPTT1erRgZB4PRquZTuIsqQp3NVh__ks5syzFbgaJpZM4QQ2s8 .

randallwhitman commented 6 years ago

For Hive-2.3, you'll need v2 of Spatial Framework, which is not yet released, so it will be necessary to build from source.

For the purposes of troubleshooting, are you able to create a table with a geometry, using a different input format?

1505,POINT(15 5)
0535,POINT(5 35)
2323,POINT(23 23)
3222,POINT(32 22)
3728,POINT(37 28)
2233,POINT(22 33)
2838,POINT(28 38)
3434,POINT(34 34)
6219,POINT(62 19)
7114,POINT(71 14)
7525,POINT(75 25)
6535,POINT(65 35)
5549,POINT(55 49)
6545,POINT(65 45)
4566,POINT(45 66)
CREATE TABLE `test15csv`(
  `rowid` int, 
  `wkt` string)
ROW FORMAT DELIMITED 
  FIELDS TERMINATED BY ',' 
STORED AS INPUTFORMAT 
  'org.apache.hadoop.mapred.TextInputFormat' 
OUTPUTFORMAT 
  'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat'

select rowid, ST_AsText(ST_GeomFromText(wkt)) from test15csv;

pidubey commented 6 years ago

Dear Randall

       Thanks for the information.  Can u pls let me know the softwares

and version requirement to build V2 spatial framework from source. Current spatial framework jar works with which version of Hive.

Thanks with regards

Piyush

On Nov 3, 2017 10:29 PM, "Randall Whitman" notifications@github.com wrote:

For Hive-2.3, you'll need v2 of Spatial Framework https://github.com/Esri/spatial-framework-for-hadoop/wiki/ST_Geometry-for-Hive-Compatibility-with-Hive-Versions, which is not yet released, so it will be necessary to build from source.

For the purposes of troubleshooting, are you able to create a table with a geometry, using a different input format?

1505,POINT(15 5) 0535,POINT(5 35) 2323,POINT(23 23) 3222,POINT(32 22) 3728,POINT(37 28) 2233,POINT(22 33) 2838,POINT(28 38) 3434,POINT(34 34) 6219,POINT(62 19) 7114,POINT(71 14) 7525,POINT(75 25) 6535,POINT(65 35) 5549,POINT(55 49) 6545,POINT(65 45) 4566,POINT(45 66)

CREATE TABLE test15csv( rowid int, wkt string) ROW FORMAT DELIMITED FIELDS TERMINATED BY ',' STORED AS INPUTFORMAT 'org.apache.hadoop.mapred.TextInputFormat' OUTPUTFORMAT 'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat'

select rowid, ST_AsText(ST_GeomFromText(wkt)) from test15csv;

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/Esri/spatial-framework-for-hadoop/issues/133#issuecomment-341764713, or mute the thread https://github.com/notifications/unsubscribe-auth/AfzPTU1i1w8BYnjxbbS3FLBmzcuVpTrnks5sy0ZagaJpZM4QQ2s8 .

randallwhitman commented 6 years ago

Build with maven and JDK as per https://github.com/Esri/spatial-framework-for-hadoop/blob/master/README.md . I'd expect Spatial Framework v1.2 to work with Hive 0.10 .. 2.1.

pidubey commented 6 years ago

Thanks for the information. Have a good day.

On Nov 4, 2017 1:33 AM, "Randall Whitman" notifications@github.com wrote:

Build with maven and JDK as per https://github.com/Esri/ spatial-framework-for-hadoop/blob/master/README.md . I'd expect Spatial Framework v1.2 https://github.com/Esri/spatial-framework-for-hadoop/releases/tag/v1.2.0 to work with Hive 0.10 .. 2.1 https://github.com/Esri/spatial-framework-for-hadoop/wiki/ST_Geometry-for-Hive-Compatibility-with-Hive-Versions .

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/Esri/spatial-framework-for-hadoop/issues/133#issuecomment-341811914, or mute the thread https://github.com/notifications/unsubscribe-auth/AfzPTb8dA7OGedPqEl-pb52iSQwGROJ0ks5sy3GjgaJpZM4QQ2s8 .

randallwhitman commented 6 years ago

I'd expect recently-released Spatial-Framework v2.0 to work with Hive 0.11 .. 2.3. Note: if compiling from source, you can try to use maven profiles to match the versions of Hive & Hadoop -Phive-2.3 -Phadoop-2.6.

randallwhitman commented 6 years ago

Note also 'com.esri.json.hadoop.EnclosedEsriJsonInputFormat' requires v1.2+ ; with v1.[01] only the older name would be available ~ #96.