Login  Register

[GitHub] [carbondata] maheshrajus commented on a change in pull request #4118: [CARBONDATA-4167][CARBONDATA-4168] Fix case sensitive issues and input validation for Geo values.

Posted by GitBox on Apr 22, 2021; 6:54pm
URL: http://apache-carbondata-dev-mailing-list-archive.168.s1.nabble.com/GitHub-carbondata-ShreelekhyaG-opened-a-new-pull-request-4118-WIP-Fix-case-sensitive-issues-and-inpu-tp107430p107815.html


maheshrajus commented on a change in pull request #4118:
URL: https://github.com/apache/carbondata/pull/4118#discussion_r618659835



##########
File path: integration/spark/src/main/scala/org/apache/spark/sql/parser/CarbonSparkSqlParserUtil.scala
##########
@@ -564,7 +564,7 @@ object CarbonSparkSqlParserUtil {
   def needToConvertToLowerCase(key: String): Boolean = {
     var noConvertList = Array(CarbonCommonConstants.COMPRESSOR, "PATH", "bad_record_path",
       "timestampformat", "dateformat")
-    if (key.startsWith(CarbonCommonConstants.SPATIAL_INDEX) && key.endsWith(".class")) {
+    if (key.toLowerCase.startsWith(CarbonCommonConstants.SPATIAL_INDEX) && key.endsWith(".class")) {

Review comment:
       can we add test case for validating this ? [SPATIAL_INDEX property, POLYGON, LINESTRING, and RANGELIST UDF's are case sensitive.]

##########
File path: geo/src/main/java/org/apache/carbondata/geo/GeoHashUtils.java
##########
@@ -83,6 +85,17 @@ public static long lonLat2GeoID(long longitude, long latitude, double oriLatitud
     return colRow2GeoID(ij[0], ij[1]);
   }
 
+  public static void validateUDFInputValue(Object input, String inputName, String datatype)
+      throws MalformedCarbonCommandException {
+    if (inputName.equalsIgnoreCase("gridSize") && (input == null

Review comment:
       can we declare "gridSize" as a constant and use it ?




--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[hidden email]