Git Product home page Git Product logo

Comments (5)

susodapop avatar susodapop commented on May 18, 2024

Spark SQL doesn't support saved queries / stored procedures. Therefore it's impossible with our connector.

The connector can run multi-statement queries; but only if you pass it the complete text of the query + any parameters. Spark SQL has no way to save these by name.

from databricks-sql-python.

mroy-seedbox avatar mroy-seedbox commented on May 18, 2024

Instead, these procedures could be stored as functions in whatever tool you use to make the calls.

In DBT for example, you could use macros (with parameters) or custom materializations (with variables).

from databricks-sql-python.

susodapop avatar susodapop commented on May 18, 2024

Exactly @mroy-seedbox. With Databricks workflows you can use sql task as workflow objects too, which is a similar idea.

from databricks-sql-python.

pdscodes avatar pdscodes commented on May 18, 2024

Instead, these procedures could be stored as functions in whatever tool you use to make the calls.

In DBT for example, you could use macros (with parameters) or custom materializations (with variables).

great, I tested the function and it works

cursor.execute("SELECT * FROM db.fn_dnl_act_pay_dt(%(parm1)s, %(parm2)s, %(parm3)s);", {"parm1": "abc", "parm2": "bcd", "parm3": "fgh"})

only issue is I need must add database name before the table name, or it will fail.
Exception has occurred: ServerOperationError
Table or view not found:

use view does not require add database name before table name

from databricks-sql-python.

pdscodes avatar pdscodes commented on May 18, 2024

Exactly @mroy-seedbox. With Databricks workflows you can use sql task as workflow objects too, which is a similar idea.

you mean dbt task? SQL task is not available from drop down

image
SORRY, IGNORE, THE FEATURE IS STILL IN PRIVATE PREVIEW

from databricks-sql-python.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.