Questions tagged [databricks-sql]

Questions about Databricks SQL

For questions about Databricks SQL - a serverless data warehouse on the Databricks Lakehouse Platform that lets you run all your SQL and BI applications at scale with improved performance, a unified governance model, open formats and APIs, and your tools of choice

357 questions
0
votes
2 answers

How to join two total tables using sql?

For a university work we have two tables in sql: table1: column_name1 number_P1 PARIS 10 LISBOA 20 RIO 30 table2: column_name2 number_P2 …
0
votes
2 answers

Wrapping a statement with spark.sql throws parse exception, but it runs fine with %sql magic command

The following code throws error: X = "CREATE OR REPLACE TABLE Invoices (InvoiceID INT, CustomerID INT, BillToCustomerID INT, OrderID INT, DeliveryMethodID INT, ContactPersonID INT, AccountsPersonID INT, SalespersonPersonID INT, PackedByPersonID INT,…
SouravA
  • 5,147
  • 2
  • 24
  • 49
0
votes
1 answer

Get rows which don't satisfy any of below condition

I have a table with id and different values. I want to have my output something which would looks like this id value ---------- 1 t 1 f 2 t 3 f 4 f 4 f Expected output id value --------- 3 f 4 f If we look at the output,…
sande
  • 567
  • 1
  • 10
  • 24
0
votes
1 answer

SQL Deny select doesnt work on databricks

I have enables sql acl on our databrick cluster and I am trying to deny any slect on one table from my personal user using below commands %sql REVOKE ALL PRIVILEGES on database default from `myuser@org.com`; REVOKE ALL PRIVILEGES on…
Mahdi
  • 787
  • 1
  • 8
  • 33
0
votes
1 answer

Object embedded in Databricks SQL command

I came across the following SQL command in Databricks notebook and I am confused about what is this ${da.paths.working_dir} object in following SQL command. Is it a python object or something else? SELECT * FROM…
0
votes
1 answer

data_source_id in Azure databricks

What is the data_source_id in the parameters of azure databricks ran SQL scripts. Mentioned in databricks AWS documentation that it is the ID of the data source where this query will run, but if I try to change the notebook of and run the query,…
Priya
  • 9
  • 2
0
votes
1 answer

Get previous row value based on a timestamp for matching IDs

I have a table about shipping that has information about the arrival (country and date) to a port. Now I need to extract the country where it departed from using the previous row entries. The table looks like…
0
votes
1 answer

Error in SQL statement: ParseException: mismatched input 'FROM' expecting from Databricks SQL

I am trying to update the columns based on other table data but receiving the below error Trying to execute in Databricks Error in SQL statement: ParseException: mismatched input 'FROM' expecting {, ';'}(line 8, pos 0) == SQL == UPDATE …
0
votes
1 answer

SQL Azure Data Bricks

We have a table 1 Day table aggregated with group by call_date ,tdlinx_id ,work_request_id ,category_name another table we have 1 week level data aggregated with group by week_end_date ,category_name ,sdo_reporting_name How can I populate the…
0
votes
1 answer

How do I limit users to just the DBSQL lens of Databricks? I don't want them to have access to SQL endpoints or DE & ML lenses

Here are the current options. I want to give the BI team only access to the S: SQL
Climbs_lika_Spyder
  • 6,004
  • 3
  • 39
  • 53
0
votes
1 answer

Databricks jdbc driver for Cubejs ( cube.dev)

We are trying to connect cube olap engine to databricks sql using jdbc driver (https://github.com/cube-js/cube.js/tree/master/packages/cubejs-databricks-jdbc-driver). We want to use Cube as olap layer for fast query and pre-aggregations. However, it…
SunilS
  • 2,030
  • 5
  • 34
  • 62
0
votes
1 answer

spark sql Insert string column to struct of array type column

I am trying to insert a STRING type column to an ARRAY of STRUCT TYPE column, but facing errors. Could you help to provide the right direction to do the INSERT. In databricks notebook, I have a raw table (raw_lms.rawTable) where all the columns are…
Suraj
  • 575
  • 1
  • 9
  • 23
0
votes
1 answer

Finding week of the month from the date in databricks SQL

I'm trying to get the week_of_the_month from the date in databricks sql Here is my SQL: with date as ( select EXTRACT(DAY FROM '2017-01-01') as day ) select case when day < 8 then '1' when day < 15 then '2' when day < 22 then…
R0bert
  • 507
  • 6
  • 30
0
votes
1 answer

how to comparing dataset to new data coming every week using SQL in Databricks

I want to find the number of ids changing their value every week and month every week a new dataset get entered into the database, every week same ids are added with their values, some weeks values for some ids change. I want to find the amount of…
H.M
  • 3
  • 3
0
votes
1 answer

Is it possible to connect to databricks sqlanalytics service from a django app

My clients use databricks for data engineering workloads and are interested in using databricks sqlanalytics to service their BI requirements. I want to know if it is possible to connect to databricks sqlanalytics service from django app (since most…
1 2 3
23
24