我希望使用表 skytrack_data_packet_orc 中的一些数据对表 fleet_online_orc 执行简单更新。两个表都在下面突出显示,并且还给出了查询。请帮忙。
fleet_online_orc table
-----------------------
`latitude longitude gid fleet_sim_no location ast_updated_time`
`26.8708 80.9568 21444 9828221444 Budshahnagar 2015-03-27 11:56:08.097`
`22.6958 75.8868 27534 9828027534 Samwad Nagar 2015-03-27 11:56:08.097`
`19.0918 72.8822 13458 9259113458 Jari Mari 2015-03-27 11:56:08.097`
`skytrack_data_packet_orc
-------------------------`
sim_no latitude longitude utc_date ist_time
9611170088 12.98304 77.59880 200415 2015-04-20 16:35:35.0
9611170088 12.98304 77.59880 200415 2015-04-20 16:35:19.0
9611170088 12.98304 77.59881 200415 2015-04-20 16:35:03.0
这是我正在尝试的查询......
UPDATE fleet_online_orc tar
SET
tar.al_latitude = src.latitude,
tar.al_longitude = src.longitude,
tar.al_location ='Bangalore'
FROM skytrack_data_packet_orc src
WHERE tar.fleet_sim_no = sor.sim_no
AND tar.gid = 21444;
这就是我得到的错误..
UPDATE bd_fleet.fleet_online_orc tar
SET tar.al_latitude = sor.latitude, tar.al_longitude = sor.longitude, tar.al_location = 'Bangalore'
FROM bd_fleet.skytrack_data_packet_orc sor
WHERE tar.fleet_sim_no = sor.sim_no
AND tar.gid = 2089;
MismatchedTokenException(17!=20)
at org.antlr.runtime.BaseRecognizer.recoverFromMismatchedToken(BaseRecognizer.java:617)
at org.antlr.runtime.BaseRecognizer.match(BaseRecognizer.java:115)
at org.apache.hadoop.hive.ql.parse.HiveParser.columnAssignmentClause(HiveParser.java:42463)
at org.apache.hadoop.hive.ql.parse.HiveParser.setColumnsClause(HiveParser.java:42536)
at org.apache.hadoop.hive.ql.parse.HiveParser.updateStatement(HiveParser.java:42682)
at org.apache.hadoop.hive.ql.parse.HiveParser.execStatement(HiveParser.java:1604)
at org.apache.hadoop.hive.ql.parse.HiveParser.statement(HiveParser.java:1052)
at org.apache.hadoop.hive.ql.parse.ParseDriver.parse(ParseDriver.java:199)
at org.apache.hadoop.hive.ql.parse.ParseDriver.parse(ParseDriver.java:166)
at org.apache.hadoop.hive.ql.Driver.compile(Driver.java:389)
at org.apache.hadoop.hive.ql.Driver.compile(Driver.java:303)
at org.apache.hadoop.hive.ql.Driver.compileInternal(Driver.java:1067)
at org.apache.hadoop.hive.ql.Driver.runInternal(Driver.java:1129)
at org.apache.hadoop.hive.ql.Driver.run(Driver.java:1004)
at org.apache.hadoop.hive.ql.Driver.run(Driver.java:994)
at org.apache.hadoop.hive.cli.CliDriver.processLocalCmd(CliDriver.java:247)
at org.apache.hadoop.hive.cli.CliDriver.processCmd(CliDriver.java:199)
at org.apache.hadoop.hive.cli.CliDriver.processLine(CliDriver.java:410)
at org.apache.hadoop.hive.cli.CliDriver.executeDriver(CliDriver.java:783)
at org.apache.hadoop.hive.cli.CliDriver.run(CliDriver.java:677)
at org.apache.hadoop.hive.cli.CliDriver.main(CliDriver.java:616)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.apache.hadoop.util.RunJar.run(RunJar.java:221)
at org.apache.hadoop.util.RunJar.main(RunJar.java:136)
FAILED: ParseException line 1:34 extraneous input 'tar' expecting SET near 'tar' in update statement
line 2:7 mismatched input '.' expecting = near 'tar' in update statement
~