简体   繁体   中英

Configure SQL PolyBase to access external data in MongoDB - problem

Im trying to connect SQL server using Polybase with MongoDB but Im failing to create the external data source for that. Please help ...

Im using the following code:

CREATE MASTER KEY ENCRYPTION BY PASSWORD = 'mypassword';  

CREATE DATABASE SCOPED CREDENTIAL MongoDbUser
WITH IDENTITY = 'myusername', Secret = 'thepassword';


CREATE EXTERNAL DATA SOURCE external_DS_MongoDB
WITH (
TYPE = HADOOP,
LOCATION = 'mongodb://localhost:27017', 
CREDENTIAL = MongoDbUser
);

Im expecting the create the datasource with name "external_DS_MongoDB" but Im facing the following error in SQL:

Msg 105007, Level 16, State 1, Line 26 Scheme of the input URI is not supported. Please revise the following scheme and try again: 'mongodb'

Can anybody advice me ?

Thanks.

TYPE is not needed when creating a MongoDB data source:

CREATE EXTERNAL DATA SOURCE external_DS_MongoDB
WITH 
(
LOCATION = 'mongodb://localhost:27017', 
CREDENTIAL = MongoDbUser
);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM