Skip to content

Commit

Permalink
Merge pull request #20 from databendcloud/fix/delstmt-test
Browse files Browse the repository at this point in the history
fix: add delete stmt generate test
  • Loading branch information
hantmac authored Nov 28, 2023
2 parents 12c046f + 950e0ce commit 18993d6
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,15 @@ public void DatabendStatementFactory() {
String insertStatement = DatabendStatementFactory.getInsertIntoStatement("test", fields);
assertEquals("INSERT INTO `test`(`column1`, `column2`) VALUES (?, ?)", insertStatement);

String[] keyFields = {"column1"};
String[] keyFields = {"column1", "column2"};
// String[] partitionFields = {"column2"};

String replaceIntoStatement = DatabendStatementFactory.getReplaceIntoStatement("test", fields, keyFields);
System.out.println(replaceIntoStatement);
assertEquals("REPLACE INTO `test`(`column1`, `column2`) ON (`column1`) VALUES (?, ?)", replaceIntoStatement);
assertEquals("REPLACE INTO `test`(`column1`, `column2`) ON (`column1`, `column2`) VALUES (?, ?)", replaceIntoStatement);

String deleteStatement = DatabendStatementFactory.getDeleteStatement("test", "default", keyFields);
System.out.println(deleteStatement);
assertEquals("DELETE FROM `default`.`test` WHERE `column1`=? AND `column2`=?", deleteStatement);
}
}

0 comments on commit 18993d6

Please sign in to comment.