我无法通过shell脚本查询spark中的表。但是如果我通过命令行运行,我就能得到结果。当我在shell中插入这些命令并尝试运行时,出现了问题。 已创建shell脚本: vi test.sh 在spark shell命令下插入 火花壳 val results =sqlContext.sql("SELECT * from table_name ")
results.show() 它正在进入spark shell,但未运行以下两个命令 val results =sqlContext.sql("SELECT * from table_name ") results
/bin/bash hive <<!> hive_out.log create table GoodRecords( id int, name string, state string, phone_no int, gender string的脚本
id int,名称字符串,状态字符串,phone_no int,性别字符串)行格式分隔字段,以“,”作为文本文件存储;hive>退出;GUI显示表已经创