cancel
Showing results for 
Search instead for 
Did you mean: 

Can I create a custom SQL query?

Eu Jin
Data Scientist
Data Scientist

Can I create a custom SQL query?

Hey all 

 

I wanted to post a seeded question, I get this question a lot from our customers, and many people in DataRobot don't know about this either. So I wanted to share this with the broader community 

 

The question is: 

Can I create a custom SQL query in DataRobot? 

 

The more specific question is: 

Can I create a custom SQL query in DataRobot, without having to first extract the data to AI Catalog? 

 

 

Labels (1)
1 Reply
Eu Jin
Data Scientist
Data Scientist

The answer is YES of course! Here's a step by step guide: 

 

  • First go to your Profile icon and select Data Connections like below: Data ConnectionsData Connections

 

  • If you haven't created a data connection before, go ahead a create a new one by clicking on Add new data connection:
    Add new data connectionAdd new data connection

 

  • Setup your connection details such as the data warehouse you're using and its JDCB connection url. I this case I'm using Snowflake as an example: 

setup database connection detailssetup database connection details

 

  • Once that's done and you tested the connection works, then you want to navigate to Data Sources, its within this particular section on a sub-tab. Then go ahead and click on Create new data source:

 go to data sourcesgo to data sources

 

  • So here's where you can create a custom SQL query. By selecting the SQL query section, DataRobot gives you a space where you can write the SQL query and get a preview of table results. Also you can specify the Fetch size.The Fetch Size is optional but its really important if you are dealing with a very large dataset to avoid the Java Heap size memory issue. Here's an example of writing the query. I've also named this particular query as "Simple_example". Then go ahead and click Create to save this query

  example SQL query to Snowflakeexample SQL query to Snowflake

 

  • Once you click Create, we go back to our original DataRobot landing page. Here I will ask to import data from Data Source, not URL, or HDFS or Local file or AI Catalog. Go back to Landing pageGo back to Landing page

 

  • Select your data connection (Snowflake in my case), then in the search bar, look for the query we just saved, "simple_example" in my case. Once you find it, click on Create project

Select the newly created data sourceSelect the newly created data source

 

  • And the project creates where DataRobot just extracts the dataset directly from the Data warehouse

Create the projectCreate the project

 

Hope that helps! 

@oscarjung