You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@carbondata.apache.org by ravipesala <gi...@git.apache.org> on 2017/12/04 14:28:33 UTC
[GitHub] carbondata pull request #1544: [CARBONDATA-1740][Pre-Aggregate] Fixed order ...
Github user ravipesala commented on a diff in the pull request:
https://github.com/apache/carbondata/pull/1544#discussion_r154662113
--- Diff: integration/spark2/src/main/scala/org/apache/spark/sql/hive/CarbonPreAggregateRules.scala ---
@@ -215,6 +296,49 @@ case class CarbonPreAggregateQueryRules(sparkSession: SparkSession) extends Rule
}
}
+ /**
+ * Below method will be used to extract columns from order by expression
+ * @param projectList
+ * project list from plan
+ * @param sortOrders
+ * sort order in plan
+ * @param carbonTable
+ * carbon table
+ * @param tableName
+ * table name
+ * @return query columns from expression
+ */
+ def extractQueryColumnForOrderBy(projectList: Option[Seq[NamedExpression]] = None,
+ sortOrders: Seq[SortOrder],
+ carbonTable: CarbonTable,
+ tableName: String): Seq[QueryColumn] = {
+ val list = scala.collection.mutable.ListBuffer.empty[QueryColumn]
+ if(projectList.isDefined) {
+ projectList.get.map {
+ proList =>
+ proList.transform {
+ case attr: AttributeReference =>
+ val queryColumn = getQueryColumn(attr.name, carbonTable, tableName)
+ if (null != queryColumn) {
+ list += queryColumn
--- End diff --
change it to set
---