Skip to content

Commit

Permalink
fixes #242
Browse files Browse the repository at this point in the history
  • Loading branch information
Maxim Moinat committed Jun 19, 2020
1 parent b7ff76e commit c0fdb69
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ private void createLookupFunctions() {
writer.println(" } else {");
writer.println(" statement <- paste0(statement, \" AND\")");
writer.println(" }");
writer.println(" statement <- paste0(statement, \" " + sqlFieldName + " = \", " + createSqlValueCode(rFieldName) + ")");
writer.println(" statement <- paste0(statement, \" " + sqlFieldName + "\"," + createSqlValueCode(rFieldName) + ")");
writer.println(" }");
writer.println("");
}
Expand Down Expand Up @@ -454,7 +454,7 @@ private void createGenerateTestSqlFunction() {
writer.println(" \"' AS test, CASE WHEN (SELECT COUNT(*) FROM @cdm_database_schema.\",");
writer.println(" expect$table,");
writer.println(" \" WHERE \",");
writer.println(" paste(paste(expect$fields, operators, expect$values), collapse = \" AND \"),");
writer.println(" paste(paste(expect$fields, expect$values), collapse = \" AND \"),");
writer.println(" \") \",");
writer.println(" if (expect$type == " + DEFAULT + ") \"= 0\" else if (expect$type == " + NEGATE
+ ") \"!= 0\" else paste(\"!=\", expect$rowCount),");
Expand Down Expand Up @@ -582,10 +582,10 @@ private String convertToRName(String name) {
}

private String createSqlValueCode(String rFieldName) {
return "if (is.null(" + rFieldName + ")) \"NULL\" " +
return "if (is.null(" + rFieldName + ")) \" IS NULL\" " +
"else if (is(" + rFieldName + ", \"subQuery\")) " +
"paste0(\"(\", as.character(" + rFieldName + "), \")\") " +
"else paste0(\"'\", as.character(" + rFieldName + "), \"'\")";
"paste0(\" = (\", as.character(" + rFieldName + "), \")\") " +
"else paste0(\" = '\", as.character(" + rFieldName + "), \"'\")";
}

private String convertToSqlName(String name) {
Expand Down

0 comments on commit c0fdb69

Please sign in to comment.