Created on 10-22-2019 04:17 AM - last edited on 10-22-2019 06:46 AM by VidyaSargur
Dear All.
I having issue with creating hive table with hdfs data in Azure HDInsight cluster.
i am able to create hive table from BLOB Storage but not with HDFS Data.
as below example code for taking data from blob storage:-
hive> CREATE EXTERNAL TABLE IF NOT EXISTS tsvtab (
> name string,
> region_code int,
> sal int,
> add string
> )
> ROW FORMAT DELIMITED FIELDS TERMINATED BY '\t'
> STORED AS TEXTFILE;
load data inpath 'wasb://hadoophdinsightigi-2019-10-21t07-33-15-078z@hadooighdistorage.blob.core.windows.net/user/sshuser/data.tsv' into table tsvtab;
below taking data from hdfs but not working:-
hive> CREATE EXTERNAL TABLE IF NOT EXISTS tsvtab (
> name string,
> region_code int,
> sal int,
> add string
> )
> ROW FORMAT DELIMITED FIELDS TERMINATED BY '\t'
> STORED AS TEXTFILE;
load data inpath 'wasb://hadoophdinsightigi-2019-10-21t07-33-15-078z@hadohdistorage.blob.core.windows.net//user/HadoopPOCDir/data.tsv' into table tsvtab;
so please help me....
Created 12-16-2019 04:17 AM
Hi @rohitmalhotra .
Thanks!!
i found this solution already!!!
problem was :-
not able to get exact HDFS Path as last post i mentioned .
i checked core.site.xml file with Azure HDInsight cluster DFS File path:-
Thanks
HadoopHelp
Created 10-22-2019 07:30 PM
@HadoopHelp - It seems like the "load data inpath" command is same in both the case. Please check if you shared it by mistake. Also let me know the error message you are getting while uploading the table.
Created 10-23-2019 03:53 AM
It would be great if you can share the exact error you are facing.
Also, can you please try creating the table as below:
CREATE EXTERNAL TABLE IF NOT EXISTS tsvtab (
> name string,
> region_code int,
> sal int,
> add string
> )
> ROW FORMAT DELIMITED FIELDS TERMINATED BY '\t'
> STORED AS TEXTFILE;
load data inpath 'hdfs://hadoophdinsightigi-2019-10-21t07-33-15-078z@hadohdistorage.blob.core.windows.net/user/HadoopPOCDir/data.tsv' into table tsvtab;
OR
CREATE EXTERNAL TABLE IF NOT EXISTS tsvtab (
> name string,
> region_code int,
> sal int,
> add string
> )
> ROW FORMAT DELIMITED FIELDS TERMINATED BY '\t'
> STORED AS TEXTFILE;
load data inpath '/user/HadoopPOCDir/data.tsv' into table tsvtab;
NOTE:
I have change the path from "wasb//" to "hdfs//" in the first command and removed the unwanted details from the second command.
Created on 11-17-2019 11:55 PM - edited 11-17-2019 11:55 PM
Hi @rohitmalhotra .
I want to create hive table on top hdinsight hdfs path .
so is it possible to create hive table on HDinsight HDFS path or directly we have to use blob container address .
i think i am not able to find out hdfs path from HDInsight!
Thanks
HadoopHelp
Created 12-16-2019 04:17 AM
Hi @rohitmalhotra .
Thanks!!
i found this solution already!!!
problem was :-
not able to get exact HDFS Path as last post i mentioned .
i checked core.site.xml file with Azure HDInsight cluster DFS File path:-
Thanks
HadoopHelp