【发布时间】:2017-05-13 14:08:52
【问题描述】:
我试图在 Hadoop 上对 Cloudera Impala 的 python impyla 查询中转义字符,但似乎没有任何效果。模板语法没有转义(对于数据库 API 来说不常见。)
cursor.execute('SELECT * from table where col1 = %s', tuple(["John's unescaped string"]))
产生错误。
均匀
cursor.execute('SELECT * from table where col1 = %s', tuple([json.dumps("John's unescaped string")]))
不起作用,有人知道如何为此提供解决方案吗?有没有更好的方法或更全功能的 Python 的 Impala 库?
【问题讨论】:
-
您可以编辑它以显示产生的错误吗?
标签: python hadoop cloudera impala impyla