Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in Big Data Hadoop & Spark by (32.1k points)
Can anyone tell me how to query Hadoop from the SQL server?

1 Answer

0 votes
by (45.3k points)

In SQL Server Management Studio we can now create a linked server connection to the Hadoop system using the following command:

EXEC master.dbo.sp_addlinkedserver     

@server = N'Hadoop',     

@srvproduct=N'HIVE',     

@provider=N'MSDASQL',     

@N'HDP',     

@provstr=N'Provider=MSDASQL.1;Persist Security Info=True;User ID=hue;'

Depending on your Hadoop’s security settings, you might need to provide a password for the provider string as well

In order to run a query, you can use one of the following commands:

select * from openquery (Hadoop, 'select * from table_name')

or

select * from [Hadoop].[HIVE].[default].[table_name]

If you want to learn Hadoop, I recommend this Hadoop Training program by Intellipaat.

Browse Categories

...