in the ql, you set relative path tmp/states, according to the error message, you need to set absolute path
On Wed, Apr 23, 2014 at 11:23 AM, EdwardKing <zhan...@neusoft.com> wrote: > I use hadoop 2.2.0 and hive 0.13.0, I want to create a table from an > existing file, states.hql is follows: > CREATE EXTERNAL TABLE states(abbreviation string, full_name > string) > ROW FORMAT DELIMITED > FIELDS TERMINATED BY '\t' > LOCATION 'tmp/states' ; > > > [hadoop@master ~]$ hadoop fs -ls > 14/04/22 20:17:32 WARN util.NativeCodeLoader: Unable to load native-hadoop > library for your platform... using builtin-java classes where applicable > Found 1 items > drwxr-xr-x - hadoop supergroup 0 2014-04-22 20:02 tmp > [hadoop@master ~]$ hadoop fs -put states.txt tmp/states > [hadoop@master ~]$ hadoop fs -ls tmp/states > 14/04/22 20:17:19 WARN util.NativeCodeLoader: Unable to load native-hadoop > library for your platform... using builtin-java classes where applicable > Found 1 items > -rw-r--r-- 2 hadoop supergroup 654 2014-04-22 20:02 > tmp/states/states.txt > > > Then I execute states.hql > [hadoop@master ~]$ hive -f states.hql > 14/04/22 20:11:47 INFO Configuration.deprecation: mapred.reduce.tasks is > deprecated. Instead, use mapreduce.job.reduces > 14/04/22 20:11:47 INFO Configuration.deprecation: mapred.min.split.size is > deprecated. Instead, use mapreduce.input.fileinputformat.split.minsize > 14/04/22 20:11:47 INFO Configuration.deprecation: > mapred.reduce.tasks.speculative.execution is deprecated. Instead, use > mapreduce.reduce.speculative > 14/04/22 20:11:47 INFO Configuration.deprecation: > mapred.min.split.size.per.node is deprecated. Instead, use > mapreduce.input.fileinputformat.split.minsize.per.node > 14/04/22 20:11:47 INFO Configuration.deprecation: > mapred.input.dir.recursive is deprecated. Instead, use > mapreduce.input.fileinputformat.input.dir.recursive > 14/04/22 20:11:47 INFO Configuration.deprecation: > mapred.min.split.size.per.rack is deprecated. Instead, use > mapreduce.input.fileinputformat.split.minsize.per.rack > 14/04/22 20:11:47 INFO Configuration.deprecation: mapred.max.split.size is > deprecated. Instead, use mapreduce.input.fileinputformat.split.maxsize > 14/04/22 20:11:47 INFO Configuration.deprecation: > mapred.committer.job.setup.cleanup.needed is deprecated. Instead, use > mapreduce.job.committer.setup.cleanup.needed > Logging initialized using configuration in > jar:file:/home/software/apache-hive-0.13.0-bin/lib/hive-common-0.13.0.jar!/hive-log4j.properties > FAILED: Execution Error, return code 1 from > org.apache.hadoop.hive.ql.exec.DDLTask. > MetaException(message:java.lang.IllegalArgumentException: > java.net.URISyntaxException: Relative path in absolute URI: > hdfs://master:9000./tmp/states) > > > It raise following error,why? How to correct it? > 2014-04-22 20:12:03,907 INFO [main]: exec.DDLTask > (DDLTask.java:createTable(4074)) - Default to LazySimpleSerDe for table > states > 2014-04-22 20:12:05,147 INFO [main]: metastore.HiveMetaStore > (HiveMetaStore.java:logInfo(624)) - 0: create_table: > Table(tableName:states, dbName:default, owner:hadoop, > createTime:1398222724, lastAccessTime:0, retention:0, > sd:StorageDescriptor(cols:[FieldSchema(name:abbreviation, type:string, > comment:null), FieldSchema(name:full_name, type:string, comment:null)], > location:tmp/states, inputFormat:org.apache.hadoop.mapred.TextInputFormat, > outputFormat:org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat, > compressed:false, numBuckets:-1, serdeInfo:SerDeInfo(name:null, > serializationLib:org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe, > parameters:{serialization.format= , field.delim= }), bucketCols:[], > sortCols:[], parameters:{}, skewedInfo:SkewedInfo(skewedColNames:[], > skewedColValues:[], skewedColValueLocationMaps:{}), > storedAsSubDirectories:false), partitionKeys:[], > parameters:{EXTERNAL=TRUE}, viewOriginalText:null, viewExpandedText:null, > tableType:EXTERNAL_TABLE) > 2014-04-22 20:12:05,147 INFO [main]: HiveMetaStore.audit > (HiveMetaStore.java:logAuditEvent(306)) - > ugi=hadoop ip=unknown-ip-addr cmd=create_table: Table(tableName:states, > dbName:default, owner:hadoop, createTime:1398222724, lastAccessTime:0, > retention:0, sd:StorageDescriptor(cols:[FieldSchema(name:abbreviation, > type:string, comment:null), FieldSchema(name:full_name, type:string, > comment:null)], location:tmp/states, > inputFormat:org.apache.hadoop.mapred.TextInputFormat, > outputFormat:org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat, > compressed:false, numBuckets:-1, serdeInfo:SerDeInfo(name:null, > serializationLib:org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe, > parameters:{serialization.format= , field.delim= }), bucketCols:[], > sortCols:[], parameters:{}, skewedInfo:SkewedInfo(skewedColNames:[], > skewedColValues:[], skewedColValueLocationMaps:{}), > storedAsSubDirectories:false), partitionKeys:[], > parameters:{EXTERNAL=TRUE}, viewOriginalText:null, viewExpandedText:null, > tableType:EXTERNAL_TABLE) > 2014-04-22 20:12:05,196 ERROR [main]: metastore.RetryingHMSHandler > (RetryingHMSHandler.java:invoke(143)) - > MetaException(message:java.lang.IllegalArgumentException: > java.net.URISyntaxException: Relative path in absolute URI: > hdfs://master:9000./tmp/states) > at > org.apache.hadoop.hive.metastore.HiveMetaStore$HMSHandler.newMetaException(HiveMetaStore.java:4616) > at > org.apache.hadoop.hive.metastore.HiveMetaStore$HMSHandler.create_table_with_environment_context(HiveMetaStore.java:1309) > 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:601) > at > org.apache.hadoop.hive.metastore.RetryingHMSHandler.invoke(RetryingHMSHandler.java:105) > at $Proxy8.create_table_with_environment_context(Unknown Source) > at > org.apache.hadoop.hive.metastore.HiveMetaStoreClient.createTable(HiveMetaStoreClient.java:558) > at > org.apache.hadoop.hive.metastore.HiveMetaStoreClient.createTable(HiveMetaStoreClient.java:547) > 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:601) > at > org.apache.hadoop.hive.metastore.RetryingMetaStoreClient.invoke(RetryingMetaStoreClient.java:89) > at $Proxy9.createTable(Unknown Source) > at org.apache.hadoop.hive.ql.metadata.Hive.createTable(Hive.java:613) > at org.apache.hadoop.hive.ql.exec.DDLTask.createTable(DDLTask.java:4194) > at org.apache.hadoop.hive.ql.exec.DDLTask.execute(DDLTask.java:281) > 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:1472) > at org.apache.hadoop.hive.ql.Driver.execute(Driver.java:1239) > at org.apache.hadoop.hive.ql.Driver.runInternal(Driver.java:1057) > at org.apache.hadoop.hive.ql.Driver.run(Driver.java:880) > at org.apache.hadoop.hive.ql.Driver.run(Driver.java:870) > 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.processLine(CliDriver.java:359) > at org.apache.hadoop.hive.cli.CliDriver.processReader(CliDriver.java:456) > at org.apache.hadoop.hive.cli.CliDriver.processFile(CliDriver.java:466) > at org.apache.hadoop.hive.cli.CliDriver.executeDriver(CliDriver.java:748) > 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:57) > at > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) > at java.lang.reflect.Method.invoke(Method.java:601) > at org.apache.hadoop.util.RunJar.main(RunJar.java:212) > Caused by: java.lang.IllegalArgumentException: > java.net.URISyntaxException: Relative path in absolute URI: > hdfs://master:9000./tmp/states > at org.apache.hadoop.fs.Path.initialize(Path.java:206) > at org.apache.hadoop.fs.Path.<init>(Path.java:197) > at > org.apache.hadoop.hive.metastore.Warehouse.getDnsPath(Warehouse.java:145) > at > org.apache.hadoop.hive.metastore.HiveMetaStore$HMSHandler.create_table_core(HiveMetaStore.java:1232) > at > org.apache.hadoop.hive.metastore.HiveMetaStore$HMSHandler.create_table_with_environment_context(HiveMetaStore.java:1295) > ... 38 more > Caused by: java.net.URISyntaxException: Relative path in absolute URI: > hdfs://master:9000./tmp/states > at java.net.URI.checkPath(URI.java:1804) > at java.net.URI.<init>(URI.java:752) > at org.apache.hadoop.fs.Path.initialize(Path.java:203) > ... 42 more > > 2014-04-22 20:12:05,223 ERROR [main]: exec.DDLTask > (DDLTask.java:execute(478)) - > org.apache.hadoop.hive.ql.metadata.HiveException: > MetaException(message:java.lang.IllegalArgumentException: > java.net.URISyntaxException: Relative path in absolute URI: > hdfs://master:9000./tmp/states) > at org.apache.hadoop.hive.ql.metadata.Hive.createTable(Hive.java:619) > at org.apache.hadoop.hive.ql.exec.DDLTask.createTable(DDLTask.java:4194) > at org.apache.hadoop.hive.ql.exec.DDLTask.execute(DDLTask.java:281) > 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:1472) > at org.apache.hadoop.hive.ql.Driver.execute(Driver.java:1239) > at org.apache.hadoop.hive.ql.Driver.runInternal(Driver.java:1057) > at org.apache.hadoop.hive.ql.Driver.run(Driver.java:880) > at org.apache.hadoop.hive.ql.Driver.run(Driver.java:870) > 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.processLine(CliDriver.java:359) > at org.apache.hadoop.hive.cli.CliDriver.processReader(CliDriver.java:456) > at org.apache.hadoop.hive.cli.CliDriver.processFile(CliDriver.java:466) > at org.apache.hadoop.hive.cli.CliDriver.executeDriver(CliDriver.java:748) > 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:57) > at > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) > at java.lang.reflect.Method.invoke(Method.java:601) > at org.apache.hadoop.util.RunJar.main(RunJar.java:212) > Caused by: MetaException(message:java.lang.IllegalArgumentException: > java.net.URISyntaxException: Relative path in absolute URI: > hdfs://master:9000./tmp/states) > at > org.apache.hadoop.hive.metastore.HiveMetaStore$HMSHandler.newMetaException(HiveMetaStore.java:4616) > at > org.apache.hadoop.hive.metastore.HiveMetaStore$HMSHandler.create_table_with_environment_context(HiveMetaStore.java:1309) > 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:601) > at > org.apache.hadoop.hive.metastore.RetryingHMSHandler.invoke(RetryingHMSHandler.java:105) > at $Proxy8.create_table_with_environment_context(Unknown Source) > at > org.apache.hadoop.hive.metastore.HiveMetaStoreClient.createTable(HiveMetaStoreClient.java:558) > at > org.apache.hadoop.hive.metastore.HiveMetaStoreClient.createTable(HiveMetaStoreClient.java:547) > 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:601) > at > org.apache.hadoop.hive.metastore.RetryingMetaStoreClient.invoke(RetryingMetaStoreClient.java:89) > at $Proxy9.createTable(Unknown Source) > at org.apache.hadoop.hive.ql.metadata.Hive.createTable(Hive.java:613) > ... 23 more > Caused by: java.lang.IllegalArgumentException: > java.net.URISyntaxException: Relative path in absolute URI: > hdfs://master:9000./tmp/states > at org.apache.hadoop.fs.Path.initialize(Path.java:206) > at org.apache.hadoop.fs.Path.<init>(Path.java:197) > at > org.apache.hadoop.hive.metastore.Warehouse.getDnsPath(Warehouse.java:145) > at > org.apache.hadoop.hive.metastore.HiveMetaStore$HMSHandler.create_table_core(HiveMetaStore.java:1232) > at > org.apache.hadoop.hive.metastore.HiveMetaStore$HMSHandler.create_table_with_environment_context(HiveMetaStore.java:1295) > ... 38 more > Caused by: java.net.URISyntaxException: Relative path in absolute URI: > hdfs://master:9000./tmp/states > at java.net.URI.checkPath(URI.java:1804) > at java.net.URI.<init>(URI.java:752) > at org.apache.hadoop.fs.Path.initialize(Path.java:203) > ... 42 more > > 2014-04-22 20:12:05,224 ERROR [main]: ql.Driver > (SessionState.java:printError(543)) - FAILED: Execution Error, return code > 1 from org.apache.hadoop.hive.ql.exec.DDLTask. > MetaException(message:java.lang.IllegalArgumentException: > java.net.URISyntaxException: Relative path in absolute URI: > hdfs://master:9000./tmp/states) > 2014-04-22 20:12:05,225 INFO [main]: log.PerfLogger > (PerfLogger.java:PerfLogEnd(135)) - </PERFLOG method=Driver.execute > start=1398222723851 end=1398222725224 duration=1373 > from=org.apache.hadoop.hive.ql.Driver> > 2014-04-22 20:12:05,225 INFO [main]: log.PerfLogger > (PerfLogger.java:PerfLogBegin(108)) - <PERFLOG method=releaseLocks > from=org.apache.hadoop.hive.ql.Driver> > 2014-04-22 20:12:05,225 INFO [main]: log.PerfLogger > (PerfLogger.java:PerfLogEnd(135)) - </PERFLOG method=releaseLocks > start=1398222725225 end=1398222725225 duration=0 > from=org.apache.hadoop.hive.ql.Driver> > 2014-04-22 20:12:05,228 INFO [main]: log.PerfLogger > (PerfLogger.java:PerfLogBegin(108)) - <PERFLOG method=releaseLocks > from=org.apache.hadoop.hive.ql.Driver> > 2014-04-22 20:12:05,229 INFO [main]: log.PerfLogger > (PerfLogger.java:PerfLogEnd(135)) - </PERFLOG method=releaseLocks > start=1398222725228 end=1398222725229 duration=1 > from=org.apache.hadoop.hive.ql.Driver> > > > --------------------------------------------------------------------------------------------------- > Confidentiality Notice: The information contained in this e-mail and any > accompanying attachment(s) > is intended only for the use of the intended recipient and may be > confidential and/or privileged of > Neusoft Corporation, its subsidiaries and/or its affiliates. If any reader > of this communication is > not the intended recipient, unauthorized use, forwarding, printing, > storing, disclosure or copying > is strictly prohibited, and may be unlawful.If you have received this > communication in error,please > immediately notify the sender by return e-mail, and delete the original > message and all copies from > your system. Thank you. > > --------------------------------------------------------------------------------------------------- > -- Regards Shengjun