VenuReddy2103 commented on a change in pull request #3436: [CARBONDATA-3548]Geospatial Support: Modified to create and load the table with a nonschema dimension sort column. And added InPolygon UDF
URL:
https://github.com/apache/carbondata/pull/3436#discussion_r356013644
##########
File path: integration/spark-common/src/main/scala/org/apache/spark/sql/catalyst/CarbonDDLSqlParser.scala
##########
@@ -268,6 +309,151 @@ abstract class CarbonDDLSqlParser extends AbstractCarbonSparkSQLParser {
}
}
+ /**
+ * The method parses, validates and processes the index_handler property.
+ *
+ * @param tableProperties Table properties
+ * @param tableFields Sequence of table fields
+ * @return <Seq[Field]> Sequence of table fields
+ *
+ */
+ private def processIndexProperty(tableProperties: mutable.Map[String, String],
+ tableFields: Seq[Field]): Seq[Field] = {
+ val option = tableProperties.get(CarbonCommonConstants.INDEX_HANDLER)
+ val fields = ListBuffer[Field]()
+ if (option.isDefined) {
+ if (option.get.isEmpty) {
+ throw new MalformedCarbonCommandException(
+ s"Carbon ${CarbonCommonConstants.INDEX_HANDLER} property is invalid. " +
+ s"Option value is empty.")
+ }
+
+ val handlers = option.get.split(",")
+ handlers.foreach { e =>
+ /* Validate target column name */
+ if (tableFields.exists(_.column.equalsIgnoreCase(e))) {
+ throw new MalformedCarbonCommandException(
+ s"Carbon ${CarbonCommonConstants.INDEX_HANDLER} property is invalid. " +
+ s"handler value : $e is not allowed. It matches with another column name in table. " +
Review comment:
Have modified message like this -
`throw new MalformedCarbonCommandException(
s"Carbon ${ CarbonCommonConstants.INDEX_HANDLER } property is invalid. " +
s"handler: $handler must not match with any other column name in the table")`
----------------------------------------------------------------
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]
With regards,
Apache Git Services