[GitHub] [carbondata] ShreelekhyaG 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
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-tp107430p107931.html


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



##########
File path: integration/spark/src/main/scala/org/apache/spark/sql/execution/strategy/CarbonSourceStrategy.scala
##########
@@ -62,10 +62,53 @@ private[sql] object CarbonSourceStrategy extends SparkStrategy {
         } catch {
           case _: CarbonPhysicalPlanException => Nil
         }
+      case Project(projectList, _: OneRowRelation) if validateUdf(projectList) => Nil
       case _ => Nil
     }
   }
 
+  private def validateUdf(projects: Seq[NamedExpression]): Boolean = {
+    projects foreach {
+      case alias: Alias if alias.child.isInstanceOf[Expression] =>
+        alias.child match {
+          case Cast(s: ScalaUDF, _, _) => validateGeoUtilUDFs(s)
+          case s: ScalaUDF => validateGeoUtilUDFs(s)
+          case _ =>
+        }
+    }
+    true
+  }
+
+  def validateGeoUtilUDFs(s: ScalaUDF): Boolean = {
+    var geoUdf = false
+    if (s.function.isInstanceOf[ToRangeListUDF]) {
+      GeoHashUtils.validateUDFInputValue(s.children.head.toString(), "polygon", "String")

Review comment:
       ok, done




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