是否可以从hive create external table命令导出/创建外部表文件到远程服务器?



是否可以从hive create external table命令导出/创建外部表文件到远程服务器

create external table SOME_TABLE (MY_Coulmns) 
row format delimited fields terminated by ','
lines terminated by 'n' 
stored as textfile location '<Remote server A with IP XXXXX and with username and password>';  

需求:我必须导出这个文件/数据从hive到Cassandra(在不同的服务器上)。

通过Hive使用带有用户名和密码的IP进行外部存储不是一个好的做法,因为它可能会成为一个安全问题。在Hive中,您可以轻松地使用外部Amazon S3存储或Azure Blob存储。

EDIT:或者,如果您能够直接从Hive访问Cassandra主机和端口,则使用Hive Cassandra StorageHandler (org.apache.hadoop.hive.cassandra.cql.CqlStorageHandler)作为Hive表的StorageHandler。这将大大简化您的工作,因为Hive将能够直接写入Cassandra中的外部表。

最新更新