Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CARBONDATA-4138] Reordering Carbon Expression instead of Spark Filter #4100

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -2602,6 +2602,11 @@ private CarbonCommonConstants() {

public static final String FILE_HEADER = "fileHeader";

@CarbonProperty(dynamicConfigurable = true)
public static final String CARBON_OPTIMIZE_FILTER = "carbon.optimize.filter";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"carbon.reorder.filter" and "carbon.optimize.filter" seem to be doing the same thing. please remove one of them

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reorder is one part of optimaztion


public static final String CARBON_OPTIMIZE_FILTER_DEFAULT = "true";

@CarbonProperty(dynamicConfigurable = true)
public static final String CARBON_REORDER_FILTER = "carbon.reorder.filter";

Original file line number Diff line number Diff line change
@@ -59,6 +59,6 @@ public String getString() {

@Override
public String getStatement() {
return "(" + left.getString() + " or " + right.getString() + ")";
return "(" + left.getStatement() + " or " + right.getStatement() + ")";
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package org.apache.carbondata.core.scan.expression.optimize;

import org.apache.carbondata.core.metadata.schema.table.CarbonTable;
import org.apache.carbondata.core.scan.expression.Expression;
import org.apache.carbondata.core.scan.expression.optimize.reorder.ExpressionReorder;
import org.apache.carbondata.core.util.CarbonProperties;

/**
* optimize Carbon Expression
*/
public class ExpressionOptimizer {

private final OptimizeRule[] rules = { new ExpressionReorder() };
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no need for private static class, make this final and use directly


public static Expression optimize(CarbonTable table, Expression expression) {
if (!CarbonProperties.isFilterOptimizeEnabled()) {
return expression;
}
for (OptimizeRule rule : ExpressionOptimizerHandler.INSTANCE.rules) {
expression = rule.optimize(table, expression);
}
return expression;
}

private static class ExpressionOptimizerHandler {
private static final ExpressionOptimizer INSTANCE = new ExpressionOptimizer();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package org.apache.carbondata.core.scan.expression.optimize;

import org.apache.carbondata.core.metadata.schema.table.CarbonTable;
import org.apache.carbondata.core.scan.expression.Expression;

/**
* the base rule of ExpressionOptimizer
*/
public abstract class OptimizeRule {

public abstract Expression optimize(CarbonTable table, Expression expression);

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package org.apache.carbondata.core.scan.expression.optimize.reorder;

import org.apache.carbondata.core.scan.expression.Expression;
import org.apache.carbondata.core.scan.expression.logical.AndExpression;

/**
* new And expression with multiple children (maybe more than two children).
*/
public class AndMultiExpression extends MultiExpression {

@Override
public boolean canMerge(Expression child) {
return child instanceof AndExpression;
}

@Override
public Expression toExpression() {
return children.stream()
.map(StorageOrdinal::toExpression)
.reduce(AndExpression::new)
.orElse(null);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package org.apache.carbondata.core.scan.expression.optimize.reorder;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.apache.carbondata.core.metadata.schema.table.CarbonTable;
import org.apache.carbondata.core.metadata.schema.table.column.CarbonColumn;
import org.apache.carbondata.core.scan.expression.Expression;
import org.apache.carbondata.core.scan.expression.optimize.OptimizeRule;
import org.apache.carbondata.core.util.CarbonProperties;

/**
* reorder Expression by storage order
*/
public class ExpressionReorder extends OptimizeRule {

@Override
public Expression optimize(CarbonTable table, Expression expression) {
if (!CarbonProperties.isFilterReorderingEnabled()) {
return expression;
}
MultiExpression multiExpression = MultiExpression.build(expression);
// unsupported expression
if (multiExpression == null) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

move this check above MultiExpression.build so that we dont enter the reorder code if null

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MultiExpression.build return "multiExpression "

return expression;
}
// remove redundancy filter
multiExpression.removeRedundant();
// combine multiple filters to single filter
multiExpression.combine();
// reorder Expression by storage ordinal of columns
multiExpression.updateMinOrdinal(columnMapOrdinal(table));
multiExpression.sortChildrenByOrdinal();
return multiExpression.toExpression();
}

private Map<String, Integer> columnMapOrdinal(CarbonTable table) {
List<CarbonColumn> createOrderColumns = table.getCreateOrderColumn();
Map<String, Integer> nameMapOrdinal = new HashMap<>(createOrderColumns.size());
int dimensionCount = table.getAllDimensions().size();
for (CarbonColumn column : createOrderColumns) {
if (column.isDimension()) {
nameMapOrdinal.put(column.getColName(), column.getOrdinal());
} else {
nameMapOrdinal.put(column.getColName(), dimensionCount + column.getOrdinal());
}
}
return nameMapOrdinal;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package org.apache.carbondata.core.scan.expression.optimize.reorder;

import java.util.List;
import java.util.Map;

import org.apache.carbondata.core.scan.expression.ColumnExpression;
import org.apache.carbondata.core.scan.expression.Expression;
import org.apache.carbondata.core.scan.expression.UnknownExpression;
import org.apache.carbondata.core.scan.expression.conditional.ConditionalExpression;

/**
* a wrapper class of Expression with storage ordinal
*/
public class ExpressionWithOrdinal extends StorageOrdinal {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

all classes inside optimize package except ExpressionReorder should have default access modifier so that they are not used for creating expressions by mistake

protected Expression expression;

public ExpressionWithOrdinal(Expression expression) {
this.minOrdinal = Integer.MAX_VALUE;
this.expression = expression;
}

@Override
public void updateMinOrdinal(Map<String, Integer> columnMapOrdinal) {
updateMinOrdinal(expression, columnMapOrdinal);
}

private void updateMinOrdinal(Expression expression, Map<String, Integer> nameMapOrdinal) {
if (expression != null && expression.getChildren() != null) {
if (expression.getChildren().size() == 0) {
if (expression instanceof ConditionalExpression) {
List<ColumnExpression> columnList =
((ConditionalExpression) expression).getColumnList();
for (ColumnExpression columnExpression : columnList) {
updateMinOrdinal(columnExpression.getColumnName(), nameMapOrdinal);
}
}
} else {
for (Expression subExpression : expression.getChildren()) {
if (subExpression instanceof ColumnExpression) {
updateMinOrdinal(((ColumnExpression) subExpression).getColumnName(), nameMapOrdinal);
} else if (expression instanceof UnknownExpression) {
UnknownExpression exp = ((UnknownExpression) expression);
List<ColumnExpression> listOfColExpression = exp.getAllColumnList();
for (ColumnExpression columnExpression : listOfColExpression) {
updateMinOrdinal(columnExpression.getColumnName(), nameMapOrdinal);
}
} else {
updateMinOrdinal(subExpression, nameMapOrdinal);
}
}
}
}
}

private void updateMinOrdinal(String columnName, Map<String, Integer> nameMapOrdinal) {
Integer ordinal = nameMapOrdinal.get(columnName.toLowerCase());
if (ordinal != null && ordinal < minOrdinal) {
minOrdinal = ordinal;
}
}

@Override
public Expression toExpression() {
return expression;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package org.apache.carbondata.core.scan.expression.optimize.reorder;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

import org.apache.carbondata.core.scan.expression.Expression;
import org.apache.carbondata.core.scan.expression.logical.AndExpression;
import org.apache.carbondata.core.scan.expression.logical.OrExpression;

/**
* new Expression with multiple children (maybe more than two children).
*/
public abstract class MultiExpression extends StorageOrdinal {

public MultiExpression() {
this.minOrdinal = Integer.MAX_VALUE;
}

protected List<StorageOrdinal> children = new ArrayList<>();

public abstract boolean canMerge(Expression child);

private void addChild(Expression child) {
addChild(new ExpressionWithOrdinal(child));
}

private void addChild(StorageOrdinal storageOrdinal) {
children.add(storageOrdinal);
}

public void removeRedundant() {
// TODO remove redundancy filter if exists
}

public void combine() {
// TODO combine multiple filters to single filter if needed
}

@Override
public void updateMinOrdinal(Map<String, Integer> columnMapOrdinal) {
for (StorageOrdinal child : children) {
child.updateMinOrdinal(columnMapOrdinal);
if (child.minOrdinal < this.minOrdinal) {
this.minOrdinal = child.minOrdinal;
}
}
}

public void sortChildrenByOrdinal() {
children.sort(null);
for (StorageOrdinal child : children) {
if (child instanceof MultiExpression) {
((MultiExpression) child).sortChildrenByOrdinal();
}
}
}

public static MultiExpression build(Expression expression) {
return new Builder().build(expression);
}

private static class Builder {
public MultiExpression build(Expression expression) {
MultiExpression multiExpression = null;
if (expression instanceof AndExpression) {
multiExpression = new AndMultiExpression();
}
if (expression instanceof OrExpression) {
multiExpression = new OrMultiExpression();
}
if (multiExpression == null) {
return null;
}
for (Expression child : expression.getChildren()) {
buildChild(child, multiExpression);
}
return multiExpression;
}

private void buildChild(Expression expression, MultiExpression parent) {
if (parent.canMerge(expression)) {
// multiple and(or) can be merge into same MultiExpression
for (Expression child : expression.getChildren()) {
buildChild(child, parent);
}
} else {
MultiExpression multiExpression = build(expression);
if (multiExpression == null) {
// it is not and/or expression
parent.addChild(expression);
} else {
// it is and, or expression
parent.addChild(multiExpression);
}
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package org.apache.carbondata.core.scan.expression.optimize.reorder;

import org.apache.carbondata.core.scan.expression.Expression;
import org.apache.carbondata.core.scan.expression.logical.OrExpression;

/**
* new Or expression with multiple children (maybe more than two children).
*/
public class OrMultiExpression extends MultiExpression {
@Override
public boolean canMerge(Expression child) {
return child instanceof OrExpression;
}

@Override
public Expression toExpression() {
return children.stream()
.map(StorageOrdinal::toExpression)
.reduce(OrExpression::new)
.orElse(null);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package org.apache.carbondata.core.scan.expression.optimize.reorder;

import java.util.Map;

import org.apache.carbondata.core.scan.expression.Expression;

/**
*
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove the empty description

*/
public abstract class StorageOrdinal implements Comparable {

protected int minOrdinal;

public abstract void updateMinOrdinal(Map<String, Integer> columnMapOrdinal);

@Override
public int compareTo(Object o) {
return Integer.compare(minOrdinal, ((StorageOrdinal) o).minOrdinal);
}

public abstract Expression toExpression();
}
Original file line number Diff line number Diff line change
@@ -2180,6 +2180,13 @@ public boolean isCleanFilesForceAllowed() {
return Boolean.parseBoolean(configuredValue);
}

public static boolean isFilterOptimizeEnabled() {
return Boolean.parseBoolean(
getInstance().getProperty(CarbonCommonConstants.CARBON_OPTIMIZE_FILTER,
CarbonCommonConstants.CARBON_OPTIMIZE_FILTER_DEFAULT)
);
}

public static boolean isFilterReorderingEnabled() {
return Boolean.parseBoolean(
getInstance().getProperty(CarbonCommonConstants.CARBON_REORDER_FILTER,
Original file line number Diff line number Diff line change
@@ -29,14 +29,14 @@ import org.apache.spark.sql.catalyst.plans.QueryPlan
import org.apache.spark.sql.catalyst.plans.physical.{HashPartitioning, Partitioning, UnknownPartitioning}
import org.apache.spark.sql.execution.{ColumnarBatchScan, DataSourceScanExec, WholeStageCodegenExec}
import org.apache.spark.sql.optimizer.CarbonFilters
import org.apache.spark.sql.types.AtomicType

import org.apache.carbondata.core.index.IndexFilter
import org.apache.carbondata.core.indexstore.PartitionSpec
import org.apache.carbondata.core.metadata.schema.BucketingInfo
import org.apache.carbondata.core.readcommitter.ReadCommittedScope
import org.apache.carbondata.core.scan.expression.Expression
import org.apache.carbondata.core.scan.expression.logical.AndExpression
import org.apache.carbondata.core.scan.expression.optimize.ExpressionOptimizer
import org.apache.carbondata.hadoop.CarbonProjection
import org.apache.carbondata.spark.rdd.CarbonScanRDD

@@ -106,6 +106,7 @@ case class CarbonDataSourceScan(

@transient private lazy val indexFilter: IndexFilter = {
val filter = pushedDownFilters.reduceOption(new AndExpression(_, _))
.map(ExpressionOptimizer.optimize(relation.carbonTable, _))
.map(new IndexFilter(relation.carbonTable, _, true)).orNull
if (filter != null && pushedDownFilters.length == 1) {
// push down the limit if only one filter
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package org.apache.spark.carbondata.query

import java.util

import org.apache.spark.sql.{CarbonEnv, CarbonThreadUtil}
import org.apache.spark.sql.test.util.QueryTest
import org.scalatest.BeforeAndAfterAll

import org.apache.carbondata.core.constants.CarbonCommonConstants
import org.apache.carbondata.core.scan.expression.{ColumnExpression, Expression, LiteralExpression}
import org.apache.carbondata.core.scan.expression.conditional.EqualToExpression
import org.apache.carbondata.core.scan.expression.logical.{AndExpression, OrExpression}
import org.apache.carbondata.core.scan.expression.optimize.ExpressionOptimizer

class TestFilterReordering extends QueryTest with BeforeAndAfterAll {

override protected def beforeAll(): Unit = {
sql("drop table if exists filter_reorder")
sql("create table filter_reorder(one string, two string, three string, four int, " +
"five int) stored as carbondata")
}

test("Test filter reorder with various conditions") {
checkOptimizer("(four = 11 and two = 11) or (one = 11)",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why pass the filter expression as string instead of Expression object?? No need for translation.

Refer: https://github.com/apache/carbondata/pull/3902/files#diff-ddfc2bc65b7f1055d4ae72fdfcdad5418e44373a6391fc348568b9a8bee506f6

"(one = 11 or (two = 11 and four = 11))")
checkOptimizer("(four = 11 or two = 11) or (one = 11 or (five = 11 or three = 11))",
"((((one = 11 or two = 11) or three = 11) or four = 11) or five = 11)")
checkOptimizer(
"(four = 11 or two = 11) or (one = 11 or (five = 11 or (three = 11 and three = 11)))",
"((((one = 11 or two = 11) or (three = 11 and three = 11)) or four = 11) or five = 11)")
}

test("test disabling filter reordering") {
sqlContext.sparkSession.sql(s"set ${ CarbonCommonConstants.CARBON_REORDER_FILTER }=false")
CarbonThreadUtil.updateSessionInfoToCurrentThread(sqlContext.sparkSession)
checkOptimizer("(four = 11 and two = 11) or (one = 11)",
"((four = 11 and two = 11) or one = 11)")
sqlContext.sparkSession.sql(s"set ${ CarbonCommonConstants.CARBON_REORDER_FILTER }=true")
}

override protected def afterAll(): Unit = {
sqlContext.sparkSession.sql(s"set ${ CarbonCommonConstants.CARBON_REORDER_FILTER }=true")
CarbonThreadUtil.updateSessionInfoToCurrentThread(sqlContext.sparkSession)
sql("drop table if exists filter_reorder")
}

private def checkOptimizer(oldFilter: String, newFilter: String): Unit = {
val table = CarbonEnv.getCarbonTable(None, "filter_reorder")(sqlContext.sparkSession)
assertResult(newFilter)(
ExpressionOptimizer.optimize(table, translate(oldFilter)).getStatement)
}

private def translate(expressionText: String): Expression = {
val data = new util.Stack[Object]()
val operation = new util.Stack[String]()
val builder = new StringBuilder()

def popExpression(op: String): Unit = {
val expression = op match {
case "=" =>
val literal = new LiteralExpression(data.pop().toString, null)
val column = new ColumnExpression(data.pop().toString, null)
new EqualToExpression(column, literal)
case "and" =>
val right = data.pop().asInstanceOf[Expression]
val left = data.pop().asInstanceOf[Expression]
new AndExpression(left, right)
case "or" =>
val right = data.pop().asInstanceOf[Expression]
val left = data.pop().asInstanceOf[Expression]
new OrExpression(left, right)
}
data.push(expression)
}

def popMultiExpression(): Unit = {
var op = operation.pop()
while (!"(".equalsIgnoreCase(op)) {
popExpression(op)
op = operation.pop()
}
}

expressionText.toCharArray.foreach {
case ' ' =>
if (builder.nonEmpty) {
val cell = builder.toString()
builder.clear()
if ("and".equalsIgnoreCase(cell) || "or".equalsIgnoreCase(cell)) {
operation.push(cell)
} else {
data.push(cell)
if ("11".equalsIgnoreCase(cell)) {
popExpression(operation.pop())
}
}
}
case '(' => operation.push("(")
case ')' =>
if (builder.nonEmpty) {
data.push(builder.toString())
builder.clear()
}
popMultiExpression()
case '=' => operation.push("=")
case c => builder.append(c)
}
while (!operation.isEmpty) {
popExpression(operation.pop())
}
data.pop().asInstanceOf[Expression]
}
}