mirror of
				https://github.com/OpenSPG/openspg.git
				synced 2025-11-03 19:45:23 +00:00 
			
		
		
		
	fix(reasoner): bugfix in AggregationPlanner (#80)
This commit is contained in:
		
							parent
							
								
									92e4209fd2
								
							
						
					
					
						commit
						5a43c1c0fb
					
				
							
								
								
									
										12
									
								
								.scalafmt.conf
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										12
									
								
								.scalafmt.conf
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,12 @@
 | 
			
		||||
version = 2.7.5
 | 
			
		||||
align = none
 | 
			
		||||
align.openParenDefnSite = false
 | 
			
		||||
align.openParenCallSite = false
 | 
			
		||||
align.tokens = []
 | 
			
		||||
optIn = {
 | 
			
		||||
  configStyleArguments = false
 | 
			
		||||
}
 | 
			
		||||
danglingParentheses = false
 | 
			
		||||
docstrings = JavaDoc
 | 
			
		||||
maxColumn = 98
 | 
			
		||||
newlines.topLevelStatements = [before,after]
 | 
			
		||||
@ -22,11 +22,7 @@ import com.antgroup.openspg.reasoner.lube.catalog.struct.Field
 | 
			
		||||
import com.antgroup.openspg.reasoner.lube.common.expr.Aggregator
 | 
			
		||||
import com.antgroup.openspg.reasoner.lube.common.graph._
 | 
			
		||||
import com.antgroup.openspg.reasoner.lube.logical._
 | 
			
		||||
import com.antgroup.openspg.reasoner.lube.logical.operators.{
 | 
			
		||||
  Aggregate,
 | 
			
		||||
  LogicalOperator,
 | 
			
		||||
  StackingLogicalOperator
 | 
			
		||||
}
 | 
			
		||||
import com.antgroup.openspg.reasoner.lube.logical.operators.{Aggregate, LogicalLeafOperator, LogicalOperator}
 | 
			
		||||
import com.antgroup.openspg.reasoner.lube.utils.ExprUtils
 | 
			
		||||
import org.apache.commons.lang3.StringUtils
 | 
			
		||||
 | 
			
		||||
@ -108,7 +104,8 @@ class AggregationPlanner(group: List[String], aggregations: Aggregations) {
 | 
			
		||||
 | 
			
		||||
  private def getTargetAlias(aliasSet: Set[String], dependency: LogicalOperator): String = {
 | 
			
		||||
    val aliasOrder = dependency.transform[String] {
 | 
			
		||||
      case (stackOp: StackingLogicalOperator, list) =>
 | 
			
		||||
      case (leafOp: LogicalLeafOperator, _) => ""
 | 
			
		||||
      case (stackOp: LogicalOperator, list) =>
 | 
			
		||||
        if (StringUtils.isEmpty(list.head)) {
 | 
			
		||||
          val curAliasSet = stackOp.fields.map(_.name).toSet
 | 
			
		||||
          if (aliasSet.diff(curAliasSet).isEmpty) {
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user