package test.hive;

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

public class ReplaceTest {
   public static String replace_1 = "insert into users_1 values(1,'asdasd','ddd')";
   public static String replace_2 = "select *from users_1 where name = 'sssss'";

   public static void main(String[] args) {
      ExecTest exec = new ExecTest();
      List<Map> replaceList = new ArrayList();
      Map<String, Object> col_1 = new HashMap();
      col_1.put("columnKey", "id");
      col_1.put("columnValue", "1");
      Map<String, String> col_2 = new HashMap();
      col_2.put("columnKey", "name");
      col_2.put("columnValue", "jm_asdwasdasd");
      Map<String, String> col_3 = new HashMap();
      col_3.put("columnKey", "password");
      col_3.put("columnValue", "jm_password");
      replaceList.add(col_2);
      String res = exec.execSqlPraseAndReplace(replace_2, replaceList);
      print(res);
   }

   public static void print(String res) {
      System.out.println("\n\n====sql====");
      System.out.println(res);
   }
}
