Skip to content

Commit

Permalink
[Fix-462][Engine] Fix error in multi-table-accuracy local mode (#464)
Browse files Browse the repository at this point in the history
  • Loading branch information
zixi0825 authored Oct 13, 2024
1 parent a1e83cb commit b97eb86
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -148,9 +148,22 @@ public static String getOnClause(List<MappingColumn> mappingColumnList, Map<Stri
String[] columnList = new String[mappingColumnList.size()];
for (int i = 0; i < mappingColumnList.size(); i++) {
MappingColumn column = mappingColumnList.get(i);
columnList[i] = getCoalesceString(inputParameterValueResult.get(TABLE_ALIAS), column.getColumn(),needQuote)
columnList[i] = getCoalesceString(inputParameterValueResult.get(TABLE_ALIAS), column.getColumn(), needQuote)
+ column.getOperator()
+ getCoalesceString(inputParameterValueResult.get(TABLE2_ALIAS), column.getColumn2(),needQuote);
+ getCoalesceString(inputParameterValueResult.get(TABLE2_ALIAS), column.getColumn2(), needQuote);
}

return String.join(AND,columnList);
}

public static String getOnClauseForLocal(List<MappingColumn> mappingColumnList, Map<String,String> inputParameterValueResult, boolean needQuote) {
//get on clause
String[] columnList = new String[mappingColumnList.size()];
for (int i = 0; i < mappingColumnList.size(); i++) {
MappingColumn column = mappingColumnList.get(i);
columnList[i] = inputParameterValueResult.get(TABLE_ALIAS) + "." + QuoteIdentifier.quote(column.getColumn(), needQuote)
+ column.getOperator()
+ inputParameterValueResult.get(TABLE2_ALIAS) + "." + QuoteIdentifier.quote(column.getColumn2(), needQuote);
}

return String.join(AND,columnList);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public void buildTransformConfigs() {
List<MappingColumn> mappingColumns = JSONUtils.toList(metricInputParameter.get(MAPPING_COLUMNS),MappingColumn.class);
metricInputParameter.put(TABLE_ALIAS_COLUMNS, MetricParserUtils.getTableAliasColumns(mappingColumns,metricInputParameter.get(TABLE_ALIAS),1, false));
metricInputParameter.put(TABLE2_ALIAS_COLUMNS, MetricParserUtils.getTableAliasColumns(mappingColumns,metricInputParameter.get(TABLE2_ALIAS),2, false));
metricInputParameter.put(ON_CLAUSE, MetricParserUtils.getOnClause(mappingColumns, metricInputParameter, false));
metricInputParameter.put(ON_CLAUSE, MetricParserUtils.getOnClauseForLocal(mappingColumns, metricInputParameter, false));
metricInputParameter.put(WHERE_CLAUSE, MetricParserUtils.getWhereClause(mappingColumns, metricInputParameter,false));

metric2InputParameter.put(metricUniqueKey, metricInputParameter);
Expand Down

0 comments on commit b97eb86

Please sign in to comment.