Uploaded image for project: 'CarbonData'
  1. CarbonData
  2. CARBONDATA-4168

UDF validation Issues related to Geospatial support

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • None
    • 2.2.0
    • None
    • None

    Description

      --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;

      Attachments

        Activity

          People

            Unassigned Unassigned
            Shreelekhya SHREELEKHYA GAMPA
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: