我们可以使用以下链接https://my.vertica.com/docs/6.0.x/HTML/index.htm#14874.htm
boolean result = stmt.execute("COPY customers FROM "
+ " '/data/customers.txt' DIRECT ENFORCELENGTH");
但它在clojure中不起作用
(clojure.java.jdbc/execute! vertica-db "copy customer1.stage_test_etl_195 from '/tmp/valid-197.csv' DELIMITER '|' DIRECT ENFORCELENGTH ")
ClassCastException java.lang.Character cannot be cast to java.lang.String clojure.java.jdbc/prepare-statement (jdbc.clj:457)
答案 0 :(得分:1)
仔细阅读clojure.jdbc文档。执行的第二个参数!应该是一个向量,第一个元素是SQL和其他(可选)参数。以下可能有效
(clojure.java.jdbc/execute! vertica-db ["copy customer1.stage_test_etl_195 from '/tmp/valid-197.csv' DELIMITER '|' DIRECT ENFORCELENGTH "])
假设这是db后端的合法声明