Commit e133c494 authored by yanchenyun's avatar yanchenyun

[Bug] [core] Use "==" to judge whether the values of referenced variables are equal.

parent e086e3ec
...@@ -82,7 +82,7 @@ public class CABuilder { ...@@ -82,7 +82,7 @@ public class CABuilder {
Set<NodeRel> columnCASRel = result.getColumnCASRel(); Set<NodeRel> columnCASRel = result.getColumnCASRel();
boolean hasChildren = false; boolean hasChildren = false;
for (NodeRel nodeRel : columnCASRel) { for (NodeRel nodeRel : columnCASRel) {
if (columnId == nodeRel.getSufId()) { if (columnId.equals(nodeRel.getSufId())) {
ColumnCA childca = (ColumnCA) result.getColumnCASMaps().get(nodeRel.getPreId()); ColumnCA childca = (ColumnCA) result.getColumnCASMaps().get(nodeRel.getPreId());
// operation = operation.replaceAll(childca.getAlias().replaceAll("\\$","\\\\$"),childca.getOperation()); // operation = operation.replaceAll(childca.getAlias().replaceAll("\\$","\\\\$"),childca.getOperation());
operation = operation.replaceAll(childca.getAlias() operation = operation.replaceAll(childca.getAlias()
......
...@@ -61,7 +61,7 @@ public class ColumnCAGenerator implements CAGenerator { ...@@ -61,7 +61,7 @@ public class ColumnCAGenerator implements CAGenerator {
} }
for (int j = 0; j < this.columnCAS.size(); j++) { for (int j = 0; j < this.columnCAS.size(); j++) {
ColumnCA columnCA = (ColumnCA) this.columnCAS.get(j); ColumnCA columnCA = (ColumnCA) this.columnCAS.get(j);
if (columnCA.getTableCA().getId() == tableCA.getId()) { if (columnCA.getTableCA().getId().equals(tableCA.getId())) {
buildColumnCAFields(tableCA, tableCA.getParentId(), columnCA); buildColumnCAFields(tableCA, tableCA.getParentId(), columnCA);
} }
} }
...@@ -118,7 +118,7 @@ public class ColumnCAGenerator implements CAGenerator { ...@@ -118,7 +118,7 @@ public class ColumnCAGenerator implements CAGenerator {
for (int i = 0; i < this.sourceTableCAS.size(); i++) { for (int i = 0; i < this.sourceTableCAS.size(); i++) {
if (this.sourceTableCAS.get(i) instanceof TableCA) { if (this.sourceTableCAS.get(i) instanceof TableCA) {
TableCA sourceTableCA = (TableCA) this.sourceTableCAS.get(i); TableCA sourceTableCA = (TableCA) this.sourceTableCAS.get(i);
if (sourceTableCA.getId() == tableCA.getId()) { if (sourceTableCA.getId().equals(tableCA.getId())) {
tableCA.setFields(sourceTableCA.getFields()); tableCA.setFields(sourceTableCA.getFields());
} }
} }
...@@ -148,7 +148,7 @@ public class ColumnCAGenerator implements CAGenerator { ...@@ -148,7 +148,7 @@ public class ColumnCAGenerator implements CAGenerator {
Integer cid = null; Integer cid = null;
for (int j = 0; j < this.columnCAS.size(); j++) { for (int j = 0; j < this.columnCAS.size(); j++) {
ColumnCA columnCA1 = (ColumnCA) this.columnCAS.get(j); ColumnCA columnCA1 = (ColumnCA) this.columnCAS.get(j);
if (columnCA1.getTableCA().getId() == tableCA.getId() && columnCA1.getName().equals(alias)) { if (columnCA1.getTableCA().getId().equals(tableCA.getId()) && columnCA1.getName().equals(alias)) {
isHad = true; isHad = true;
cid = columnCA1.getId(); cid = columnCA1.getId();
break; break;
......
...@@ -68,7 +68,7 @@ public class LineageColumnGenerator { ...@@ -68,7 +68,7 @@ public class LineageColumnGenerator {
private void matchSinkField(TableCA tableCA) { private void matchSinkField(TableCA tableCA) {
for (ColumnCA columnCA : columnCAS) { for (ColumnCA columnCA : columnCAS) {
if (columnCA.getTableId() == tableCA.getId()) { if (columnCA.getTableId().equals(tableCA.getId())) {
continue; continue;
} }
for (String fieldName : tableCA.getFields()) { for (String fieldName : tableCA.getFields()) {
...@@ -84,7 +84,7 @@ public class LineageColumnGenerator { ...@@ -84,7 +84,7 @@ public class LineageColumnGenerator {
private void buildColumnCAFields(TableCA tableCA, Integer id, ColumnCA columnCA) { private void buildColumnCAFields(TableCA tableCA, Integer id, ColumnCA columnCA) {
if (transMaps.get(id) instanceof OperatorTrans) { if (transMaps.get(id) instanceof OperatorTrans) {
if (tableCA.getId() == id) { if (tableCA.getId().equals(id)) {
return; return;
} }
OperatorTrans trans = (OperatorTrans) transMaps.get(id); OperatorTrans trans = (OperatorTrans) transMaps.get(id);
...@@ -115,13 +115,13 @@ public class LineageColumnGenerator { ...@@ -115,13 +115,13 @@ public class LineageColumnGenerator {
Integer cid = null; Integer cid = null;
for (Map.Entry<Integer, ColumnCA> item : columnCASMaps.entrySet()) { for (Map.Entry<Integer, ColumnCA> item : columnCASMaps.entrySet()) {
ColumnCA columnCA1 = item.getValue(); ColumnCA columnCA1 = item.getValue();
if (columnCA1.getTableCA().getId() == tableCA.getId() && columnCA1.getName().equals(alias)) { if (columnCA1.getTableCA().getId().equals(tableCA.getId()) && columnCA1.getName().equals(alias)) {
isHad = true; isHad = true;
cid = columnCA1.getId(); cid = columnCA1.getId();
break; break;
} }
} }
if (columnCA.getId() == cid) { if (columnCA.getId().equals(cid)) {
return; return;
} }
if (!isHad) { if (!isHad) {
...@@ -180,7 +180,7 @@ public class LineageColumnGenerator { ...@@ -180,7 +180,7 @@ public class LineageColumnGenerator {
private void buildSinkSuf(Integer preId, Integer sourcePreId) { private void buildSinkSuf(Integer preId, Integer sourcePreId) {
for (NodeRel nodeRel : columnCASRel) { for (NodeRel nodeRel : columnCASRel) {
if (nodeRel.getPreId() == preId) { if (nodeRel.getPreId().equals(preId) ) {
Integer nextSufId = nodeRel.getSufId(); Integer nextSufId = nodeRel.getSufId();
if (sinkColumns.contains(nextSufId)) { if (sinkColumns.contains(nextSufId)) {
columnCASRelChain.add(new NodeRel(sourcePreId, nextSufId)); columnCASRelChain.add(new NodeRel(sourcePreId, nextSufId));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment