You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@carbondata.apache.org by "SHREELEKHYA GAMPA (Jira)" <ji...@apache.org> on 2021/04/19 14:18:00 UTC

[jira] [Created] (CARBONDATA-4168) UDF validation Issues related to Geospatial support

SHREELEKHYA GAMPA created CARBONDATA-4168:
---------------------------------------------

             Summary: UDF  validation Issues related to Geospatial support
                 Key: CARBONDATA-4168
                 URL: https://issues.apache.org/jira/browse/CARBONDATA-4168
             Project: CarbonData
          Issue Type: Bug
            Reporter: SHREELEKHYA GAMPA


--Gives a wrong error message for size less than equal to 0.

drop table if exists source_index;

create table source_index(TIMEVALUE BIGINT,LONGITUDE long,LATITUDE long) STORED AS carbondata TBLPROPERTIES ('SPATIAL_INDEX'='mygeohash','SPATIAL_INDEX.mygeohash.type'='geohash','SPATIAL_INDEX.mygeohash.sourcecolumns'='longitude, latitude','SPATIAL_INDEX.mygeohash.originLatitude'='39.832277','SPATIAL_INDEX.mygeohash.gridSize'='50','SPATIAL_INDEX.mygeohash.conversionRatio'='1000000');

LOAD DATA inpath '/geodata/geodata2.csv' INTO TABLE source_index OPTIONS ('DELIMITER'= ',');

select longitude, latitude from source_index where IN_POLYLINE_LIST('LINESTRING (120.184179 30.327465, 120.191603 30.328946, 120.199242 30.324464, 120.190359 30.315388)', -65);

select longitude, latitude from source_index where IN_POLYLINE_LIST('LINESTRING (120.184179 30.327465, 120.191603 30.328946, 120.199242 30.324464, 120.190359 30.315388)', 0);

Scenario 2:

--Accepts Invalid Buffer Size

select longitude, latitude from source_index where IN_POLYLINE_LIST('LINESTRING (120.184179 30.327465, 120.191603 30.328946, 120.199242 30.324464), LINESTRING (120.199242 30.324464, 120.190359 30.315388)', 'X');

Scenario 3:

--Accepts negative and 0 gridSize

select LatLngToGeoId(39930753, 116302895, 39.832277, -50) as geoId;

select GeoIdToLatLng(855279270226, 39.832277, -50) as LatitudeAndLongitude;

select ToRangeList('116.321011 40.123503, 116.320311 40.122503,116.321111 40.121503, 116.321011 40.123503', 39.832277, -50) as rangeList;

select LatLngToGeoId(39930753, 116302895, 39.832277, 0) as geoId;

select GeoIdToLatLng(855279270226, 39.832277, 0) as LatitudeAndLongitude;

--Gives Wrong error message fro gridSize 0

select ToRangeList('116.321011 40.123503, 116.320311 40.122503,116.321111 40.121503, 116.321011 40.123503', 39.832277, 0) as rangeList;

Scenario 4:

--Accepting Double values for GeoId

select GeoIdToLatLng(8.55279270226, 39.832277, -50) as LatitudeAndLongitude;

select ToUpperLayerGeoId(8.55279270226) as upperLayerGeoId;

select GeoIdToGridXy(8.55279270226) as GridXY;

Scanerio 5:

--Accepting Invalid Values in All UDFs

select GeoIdToGridXy('X') as GridXY;

select LatLngToGeoId('X', 'X', 'X', 'X') as geoId;

select GeoIdToLatLng('X', 'X', 'X') as LatitudeAndLongitude;

select ToUpperLayerGeoId('X') as upperLayerGeoId;

select ToRangeList('116.321011 40.123503, 116.320311 40.122503,116.321111 40.121503, 116.321011 40.123503', 39.832277, 'X') as rangeList;

select ToRangeList('116.321011 40.123503, 116.320311 40.122503,116.321111 40.121503, 116.321011 40.123503', 'X', 50) as rangeList;



--
This message was sent by Atlassian Jira
(v8.3.4#803005)