ShreelekhyaG commented on a change in pull request #3774: URL: https://github.com/apache/carbondata/pull/3774#discussion_r460033679
########## File path: integration/spark/src/main/scala/org/apache/spark/sql/execution/command/management/CarbonInsertIntoCommand.scala ########## @@ -170,11 +171,18 @@ case class CarbonInsertIntoCommand(databaseNameOp: Option[String], convertedStaticPartition) scanResultRdd = sparkSession.sessionState.executePlan(newLogicalPlan).toRdd if (logicalPartitionRelation != null) { - if (selectedColumnSchema.length != logicalPartitionRelation.output.length) { + val properties = table.getTableInfo.getFactTable.getTableProperties.asScala + val spatialProperty = properties.get(CarbonCommonConstants.SPATIAL_INDEX) + var expectedOutput = logicalPartitionRelation.output + if (spatialProperty.isDefined && selectedColumnSchema.size + 1 == expectedOutput.length) { Review comment: Yes, select *from table includes all columns including geoSpatial. I have added a testcase for that now. This change is when a user tries to insert with original schema. Like `sql(s"insert into $table1 select 1575428400000,116285807,40084087")` ---------------------------------------------------------------- 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: us...@infra.apache.org