文件名:tweet_info.json文件中的数据如下所示:
{
"user": {
"lang": "en",
"profile_background_image_url": "http:\/\/a0.twimg.com\/images\/themes\/theme1\/bg.png",
"id_str": "568286862",
"default_profile_image": false,
"statuses_count": 595,
"profile_link_color": "0084B4",
"favourites_count": 5,
"profile_image_url_https": "https:\/\/si0.twimg.com\/profile_images\/2206373396\/image_normal.jpg",
"following": null,
"profile_background_color": "C0DEED",
"description": "Nobody can ever affect you unless you allow yourself to be affected.",
"notifications": null,
"profile_background_tile": false,
"time_zone": null,
"profile_sidebar_fill_color": "DDEEF6",
"listed_count": 0,
"contributors_enabled": false,
"geo_enabled": false,
"created_at": "Tue May 01 13:29:22 +0000 2012",
"screen_name": "Chin_Hean",
"follow_request_sent": null,
"profile_sidebar_border_color": "C0DEED",
"protected": false,
"url": null,
"default_profile": true,
"name": "\u0106hr\u00ed\u0161",
"is_translator": false,
"show_all_inline_media": false,
"verified": false,
"profile_use_background_image": true,
"followers_count": 37,
"profile_image_url": "http:\/\/a0.twimg.com\/profile_images\/2206373396\/image_normal.jpg",
"id": 568286862,
"profile_background_image_url_https": "https:\/\/si0.twimg.com\/images\/themes\/theme1\/bg.png",
"utc_offset": null,
"friends_count": 65,
"profile_text_color": "333333",
"location": "Stark Industries"
}
}
CREATE TABLE tweet_info(
user struct<lang: string, id: int, statuses_count: int, favourites_count: int, description: string,
screen_name: string, url: string, friends_count: int, followers_count: int, location: string>)
ROW FORMAT SERDE 'org.apache.hadoop.hive.contrib.serde2.JsonSerde';
SELECT user.id UserId, user.screen_name UserName, user.location UserLocation, user.description UserDescription, user.lang UserLanguage, user.friends_count UserFrndsCount from tweet_info;
作业总数=1启动作业1个reduce任务数中的1个被设置为0,因为没有reduce操作符
java.lang.IllegalArgumentException: Can not create a Path from an empty string
at org.apache.hadoop.fs.Path.checkPathArg(Path.java:127)
at org.apache.hadoop.fs.Path.<init>(Path.java:135)
at org.apache.hadoop.mapreduce.JobSubmitter.copyAndConfigureFiles(JobSubmitter.java:212)
at org.apache.hadoop.mapreduce.JobSubmitter.copyAndConfigureFiles(JobSubmitter.java:301)
at org.apache.hadoop.mapreduce.JobSubmitter.submitJobInternal(JobSubmitter.java:389)
at org.apache.hadoop.mapreduce.Job$10.run(Job.java:1285)
at org.apache.hadoop.mapreduce.Job$10.run(Job.java:1282)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAs(Subject.java:422)
at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1614)
at org.apache.hadoop.mapreduce.Job.submit(Job.java:1282)
at org.apache.hadoop.mapred.JobClient$1.run(JobClient.java:562)
at org.apache.hadoop.mapred.JobClient$1.run(JobClient.java:557)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAs(Subject.java:422)
at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1614)
at org.apache.hadoop.mapred.JobClient.submitJobInternal(JobClient.java:557)
at org.apache.hadoop.mapred.JobClient.submitJob(JobClient.java:548)
at org.apache.hadoop.hive.ql.exec.mr.ExecDriver.execute(ExecDriver.java:420)
at org.apache.hadoop.hive.ql.exec.mr.MapRedTask.execute(MapRedTask.java:136)
at org.apache.hadoop.hive.ql.exec.Task.executeTask(Task.java:153)
at org.apache.hadoop.hive.ql.exec.TaskRunner.runSequential(TaskRunner.java:85)
at org.apache.hadoop.hive.ql.Driver.launchTask(Driver.java:1503)
at org.apache.hadoop.hive.ql.Driver.execute(Driver.java:1270)
at org.apache.hadoop.hive.ql.Driver.runInternal(Driver.java:1088)
at org.apache.hadoop.hive.ql.Driver.run(Driver.java:911)
at org.apache.hadoop.hive.ql.Driver.run(Driver.java:901)
at org.apache.hadoop.hive.cli.CliDriver.processLocalCmd(CliDriver.java:268)
at org.apache.hadoop.hive.cli.CliDriver.processCmd(CliDriver.java:220)
at org.apache.hadoop.hive.cli.CliDriver.processLine(CliDriver.java:423)
at org.apache.hadoop.hive.cli.CliDriver.executeDriver(CliDriver.java:792)
at org.apache.hadoop.hive.cli.CliDriver.run(CliDriver.java:686)
at org.apache.hadoop.hive.cli.CliDriver.main(CliDriver.java:625)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.hadoop.util.RunJar.main(RunJar.java:212)
Job Submission failed with exception 'java.lang.IllegalArgumentException(Can not create a Path from an empty string)'
FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.mr.MapRedTask
我终于想出了解决问题的办法。下面是我所做的更改,这些更改解决了我所有的错误。
这解决了我所有的错误,并最终得到了我的输出。
当我运行以下配置单元命令时 hive-e‘选择msg,将(*)从表中计数为cnt,其中像“%abcd%”这样的msg按msg排序按cnt desc;’sed的/[\t]/,/g'>table.csv 失败:ParseException第1:89行无法识别表达式规范中“like”“%”“password”附近的输入 我知道在指定字符串“%abcd%”时有问题。该命令在配置单元环境中工作正常,但这里我
每次运行代码(如下)时,我都会收到一个空指针错误,它指向用两个星号指定的行。 我是ApachePOI的新手,正在尝试将数据写入第二张excel表格(Sheet2)中的空白单元格。我做错什么了吗?
这是我的问题。 我在犯错误。 Java语言lang.IllegalArgumentException:在EntityManager中创建查询时发生异常:异常描述:语法错误分析查询[select sum(u.expenseAmount),u.wdExpenseGroup.expenseGroupName from WdExpense u其中MONTH(CAST(u.expenseDate as da
我正在学习Oracle.com上的基本I/O教程,但我在创建Path对象方面遇到了困难: 我在Linux上,我在Eclipse Kepler中工作。我正在尝试访问当前目录中的一个文本文件。使用扫描仪和文件,我可以处理文件,但我也想摆弄一个文件的路径,这样我就可以继续与教程。 编辑:整个程序如下所示。后半部分是我作为一个菜鸟,并确认文件存在/工作。当我注释掉路径定义时,我会得到“test”的输出,它
问题内容: 通常,在使用SELECT查询数据库时,通常希望查找与给定搜索字符串匹配的记录。 例如: 该查询应为我提供所有记录,其中“ Bob Smith”出现在名称字段中的任何位置。 我想做的是相反的。 我想查找名称字段在“ Robert Bob Smith III,PhD。”(查询的字符串参数)中的所有记录,而不是查找在名称字段中具有“ Bob Smith”的所有记录。 问题答案: 只是转一下喜
我有一个Hive表,它的数据存储为ORC。我在某些字段中写入空值(空白,‘“”),但有时当我对该表运行select查询时,空字符串列在查询结果中显示为NULL。我想看看我输入的空值,这怎么可能?