carbondata-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ravipesala <...@git.apache.org>
Subject [GitHub] carbondata pull request #1508: [CARBONDATA-1738] [PreAgg] Block direct inser...
Date Sun, 26 Nov 2017 11:58:10 GMT
Github user ravipesala commented on a diff in the pull request:

    https://github.com/apache/carbondata/pull/1508#discussion_r153067591
  
    --- Diff: integration/spark2/src/main/scala/org/apache/spark/sql/execution/command/preaaggregate/CreatePreAggregateTableCommand.scala
---
    @@ -94,10 +95,22 @@ case class CreatePreAggregateTableCommand(
           dmproperties.foreach(f => childSchema.getProperties.put(f._1, f._2))
           // updating the parent table about child table
           PreAggregateUtil.updateMainTable(parentDbName, parentTableName, childSchema, sparkSession)
    -      val loadAvailable = PreAggregateUtil.checkMainTableLoad(parentTable)
    -      if (loadAvailable) {
    -        sparkSession.sql(
    -          s"insert into ${ tableModel.databaseName }.${ tableModel.tableName } $queryString")
    +      val availableLoads = PreAggregateUtil.checkMainTableLoad(parentTable)
    +      if (availableLoads) {
    +        val headers = childSchema.getChildSchema.getListOfColumns.asScala.map(_.getColumnName)
    +          .mkString(",")
    +        val childDataFrame = Dataset.ofRows(sparkSession, new CarbonSpark2SqlParser()
    +          .parse(s"insert into ${ tableModel.databaseName }.${
    +            tableModel.tableName} $queryString"))
    --- End diff --
    
    why it is not just `queryString`? why insertinto required here as you are already using
load command


---

Mime
View raw message