Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

From SQl To Hadoop

From SQl To Hadoop

New Contributor

IF I have Apache Hadoop 2.7.1

With hive version

Hive 2.0.1

and i want to insert data from sql table to hadoop

i understood that i have to have hive database and install sql odbc driver on hadoop then

we can use linked query to select data from hadoop to sql server

can't we make the opposite operation by using linked query too ?

should i have to use another tool to do that like sqoop?

is sql server poly base a way to select data from hadoop to sql server only does it do the opposite operation ?

please can you put any links that is related to this topic

2 REPLIES 2

Re: From SQl To Hadoop

Expert Contributor

Re: From SQl To Hadoop

New Contributor

Hello @oula.alshiekh@gmail.com alshiekh

What ever data you have inserted into one text file or log file that can put on one path in hdfs and then write a query as follows in hive

  hive>load data inpath<<specify inputpath>>intotable<<tablename>>;

EXAMPLE:

hive>createtable foo (id int, name string)row format delimited
fields terminated by'\t'or'|'or','
stored as text file;table created..
    DATA INSERTION::
    hive>load data inpath '/home/hive/foodata.log'intotable foo;

Hope this helps, You can find more inserting into tables from SQL
https://cwiki.apache.org/confluence/display/Hive/LanguageManual+DML

Thanks.

Madison Quinn
Don't have an account?
Coming from Hortonworks? Activate your account here