I use the following Hive Query:
hive> INSERT OVERWRITE LOCAL DIRECTORY "gs:// Google/Storage/Directory/Path/Name" row format delimited fields terminated by ','
select * from <HiveDatabaseName>.<HiveTableName>;
I am getting the following error:
"Error: Failed with exception Wrong FS:"gs:// Google/Storage/Directory/PathName", expected: file:///
What could I be doing wrong?
There's a bug in Hive, including IIRC Hive 1.2.1, where it uses the configured
fs.default.nameorfs.defaultFSfor its scratchdir even if the table path is in a different filesystem. In your case, it appears you have the out-of-the-box defaults settingfs.defaultFStofile:///, which is why it says "expected: file:///". On a distributed Hadoop cluster, you might see it say "expected: hdfs://..." instead.You can fix it within the single hive prompt by overriding
fs.default.nameandfs.defaultFS:You may also want to modify those entries inside your
core-site.xmlfile to point at your GCS location to make it easier.