-
Notifications
You must be signed in to change notification settings - Fork 3
Spatial SQL Queries
Create external table table_name ([shape_col_name(s)] [shape_type], [col(s)]) partitioned by (tag string) row format delimited fields terminated by [','|'\t'|...] location '[hdfs_location]' tblproperties ('globalIndex'='[hdfs_global_master_file_location]', 'index'='shape_col_name(s) ');
Create external table table_name ([shape_col_name(s)] [shape_type], [col(s)]) partitioned by (tag string) row format delimited fields terminated by [','|'\t'|...] stored as rtree location '[hdfs_location]' tblproperties ('globalIndex'='[hdfs_global_master_file_location]', 'index'='shap e_col_name(s)');
Select [column name(s) | * ] from table_name where inside([shape_column_name(s)_separated_by_comma(s)], Rectangle(x_1,y_1,x_2,y_2)) [And|Or] expression;
Select [column name(s) | * ] from [table_name_1], [table_name_2] where overlaps([shape_1], [shape_2]) [And|Or] expression;