小编ank*_*pta的帖子

Hive 数据到 Pandas 数据框

Python 新手。

如何将数据从 hive 保存到 Pandas 数据框。

with pyhs2.connect(host, port=20000,authMechanism="PLAIN",user,password,
               database) as conn:
    with conn.cursor() as cur:
        #Show databases
        print cur.getDatabases()

        #Execute query
        cur.execute(query)

        #Return column info from query
        print cur.getSchema()

        #Fetch table results
        for i in cur.fetch():
            print i
        **columnNames = [a['columnName'] for a in  cur.getSchema()]
        print columnNames
        df1=pd.DataFrame(cur.fetch(),columnNames)**
Run Code Online (Sandbox Code Playgroud)

尝试使用列名。没用。

请。提出一些建议。

python hadoop hive pandas

6
推荐指数
2
解决办法
2万
查看次数

什么是在Spring中将属性文件值转换为字符串集的有效方法

我试过用

@Value("#{'${white.listed.hotel.ids}'.split(',')}")
private Set<String> fareAlertwhiteListedHotelIds;
Run Code Online (Sandbox Code Playgroud)

但是当white.listed.hotel.ids为空时,还设置了一个带空白值的大小.

white.listed.hotel.ids =

有人请帮我一个版本,其中whiteListedHotelIds可以包含属性文件中指定的值或没有空白案例的项目.

java spring properties-file java-8 spring-boot

2
推荐指数
1
解决办法
430
查看次数

标签 统计

hadoop ×1

hive ×1

java ×1

java-8 ×1

pandas ×1

properties-file ×1

python ×1

spring ×1

spring-boot ×1