Hive 将数据加载到表中

Hive 将数据加载到表中,hive,dbvisualizer,Hive,Dbvisualizer,我不熟悉Hive并使用DBVisualizer for Hive 我在路径*D:\data files\datafiles*中有一个文本文件。我想将其中一个文件中的数据加载到配置单元中创建的表中。当我尝试下面的方法时 load data inpath "D:\data files\sample.txt" into table sample; 它显示的错误是 cause: FAILED: Error in semantic analysis: Line 1:17 Invalid path "D

我不熟悉Hive并使用DBVisualizer for Hive

我在路径*D:\data files\datafiles*中有一个文本文件。我想将其中一个文件中的数据加载到配置单元中创建的表中。当我尝试下面的方法时

load data inpath "D:\data files\sample.txt" into table sample;
它显示的错误是

 cause: FAILED: Error in semantic analysis: Line 1:17 Invalid path "D:\data files\sample.txt": only "file" or "hdfs" file systems accepted

如何继续,将该文件放置在正确的路径和放置位置???

您可以将该文件上载到hdfs,然后使用hdfs路径尝试相同的命令

您可以使用本地关键字,如下所示

load data local inpath "D:\data files\sample.txt" into table sample;

检查此处是否存在反斜杠问题。尝试:

load data inpath "D:/data files/sample.txt" into table sample;

如果要将数据从本地计算机加载到HDFS,则必须在加载数据命令中使用“本地”:
将路径“D:\data files\sample.txt”中的数据本地加载到表sample中

加载数据有两种方法

首先从本地加载数据,然后从HDFS加载另一个数据。。。但路径在操作系统上是不同的。 如果从Linux加载数据:

将路径'/home/local/path/sample.txt'中的本地数据加载到表sample//本地路径

将路径'/home/hadoop/path/sample.txt'中的数据加载到表sample//hadoop path

如果在windows中:

将路径“D:/data files/sample.txt”中的数据加载到表sample中//此处仔细观察/不确定

将路径“D:/data files/sample.txt”中的数据本地加载到表sample中//它是本地路径

检查一下

将路径“D:\data files\sample.txt”中的本地数据加载到表sample中

通过使用上面的命令,它会查找hdfs位置,但提到的路径是本地环境,所以使用下面的命令,只有我们才能解决问题

将路径“D:\data files\sample.txt”中的本地数据加载到表sample中


通过使用覆盖到上述表格中的上述命令数据,您可能没有将sample.txt文件存储为“.txt”文件


请检查文件是否正确保存为“.txt”文件,然后重试。

该链接不再工作。有人愿意更新吗?我猜
sample
是表的名称?谢谢