EducationSoftwareStrategy.com
StrategyCommunity

Knowledge Base

Product

Community

Knowledge Base

TopicsBrowse ArticlesDeveloper Zone

Product

Download SoftwareProduct DocumentationSecurity Hub

Education

Tutorial VideosSolution GalleryEducation courses

Community

GuidelinesGrandmastersEvents
x_social-icon_white.svglinkedin_social-icon_white.svg
Strategy logoCommunity

© Strategy Inc. All Rights Reserved.

LegalTerms of UsePrivacy Policy
  1. Home
  2. Topics

KB487402: Data Source SQL Enabled for Databricks


Jinlei Cai

Quality Engineer, Senior • MicroStrategy


Starting in Strategy One (March 2025), Data Source SQL is available in Catalog Options for Databricks.

Starting in Strategy One (March 2025), you can define Data Source SQL as your catalog retrieval mode for your Databricks data source.
 
Note: ODBC calls is the default Catalog Retrieval Mode option and works for legacy Hive metastore and Unity Catalog.
 
To set Data Source SQL for catalog details:
 

  1. Create your Databricks data source connection.
  2. When adding data, right-click Databricks under Data Sources.
  3. Choose Edit Catalog Options. For more information, see Edit Catalog Options Dialog.
  4. In Catalog Options > Catalog Retrieval Mode, choose Data Source SQL from the Property Value drop-down list.

 
Using the default SQL, you can retrieve catalog details of Unity Catalog. To define the SQL scope, edit the following SQL statements replacing

'#?CATALOG_NAME?'
with your catalog name and
'#?SCHEMA_NAME?#'
with your schema name.
 

  1. Retrieve the namespaces available in the data source. 

    All namespaces will be returned but only tables only Unity Catalog will be displayed.

  2. Use the following SQL statement to retrieve tables available in the data source:

     

    select table_catalog || '.' || table_schema as NAME_SPACE, TABLE_NAME TAB_NAME from system.information_schema.tables where table_catalog = '#?CATALOG_NAME?#' and table_schema = '#?SCHEMA_NAME?#' order by 1,2


     

  3. Use the following SQL statement to retrieve columns for the selected tables:

     

    select table_catalog || '.' || table_schema as NAME_SPACE, TABLE_NAME TAB_NAME, column_name COL_NAME, data_type DATA_TYPE, CASE WHEN data_type IN ('TINYINT','BYTE') THEN 1 WHEN data_type IN ('BIGINT', 'LONG','DOUBLE') THEN 8 WHEN data_type IN ('INT','FLOAT') THEN 4 WHEN data_type IN ('SMALLINT','SHORT') THEN 2 WHEN data_type IN ('DATE') THEN 10 WHEN data_type IN ('TIMESTAMP') THEN 26 ELSE -1 END AS DATA_LEN from system.information_schema.columns where table_catalog = '#?CATALOG_NAME?#' and table_schema = '#?SCHEMA_NAME?#' and TABLE_NAME in (#TABLE_LIST#) order by 1,2


     

  4. Save the catalog option.

Additional Resource

KB485849: Connect to Databricks Unity Catalog in Update 8 or Earlier
 


Comment

0 comments

Details

Knowledge Article

Published:

March 5, 2025

Last Updated:

March 21, 2025