【问题标题】:Hive Query Insert Issues [duplicate]Hive 查询插入问题 [重复]
【发布时间】:2014-12-01 07:19:40
【问题描述】:

我在使用 Hive 插入数据时遇到问题。列出了我目前正在使用的 python 代码:

query = "INSERT INTO twitter_leads."+str(screen_name)+" ("+int(user)+','+str(input1.text)+','+int(input1.id)+")"                    
curs.execute(query)

TypeError: cannot concatenate 'str' and 'int' objects

我正在遍历 for 循环并在终端上毫无问题地打印此数据。只是不能插入到表中。我确定这不是身份验证或连接问题。

【问题讨论】:

    标签: python hadoop insert hive


    【解决方案1】:

    您可以使用 str(user)str(input.id) 代替 int()。

    【讨论】:

      猜你喜欢
      • 2013-06-29
      • 1970-01-01
      • 1970-01-01
      • 2019-07-08
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-01-12
      • 1970-01-01
      相关资源
      最近更新 更多